Class: OpenApiOpenAIClient::AssistantsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_openai/api/assistants_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AssistantsApi

Returns a new instance of AssistantsApi.



19
20
21
# File 'lib/openapi_openai/api/assistants_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/openapi_openai/api/assistants_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_run(thread_id, run_id, opts = {}) ⇒ RunObject

Cancels a run that is ‘in_progress`.

Parameters:

  • thread_id (String)

    The ID of the thread to which this run belongs.

  • run_id (String)

    The ID of the run to cancel.

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/openapi_openai/api/assistants_api.rb', line 27

def cancel_run(thread_id, run_id, opts = {})
  data, _status_code, _headers = cancel_run_with_http_info(thread_id, run_id, opts)
  data
end

#cancel_run_with_http_info(thread_id, run_id, opts = {}) ⇒ Array<(RunObject, Integer, Hash)>

Cancels a run that is &#x60;in_progress&#x60;.

Parameters:

  • thread_id (String)

    The ID of the thread to which this run belongs.

  • run_id (String)

    The ID of the run to cancel.

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

    the optional parameters

Returns:

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

    RunObject data, response status code and response headers



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
# File 'lib/openapi_openai/api/assistants_api.rb', line 37

def cancel_run_with_http_info(thread_id, run_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.cancel_run ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.cancel_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 AssistantsApi.cancel_run"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/runs/{run_id}/cancel'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', 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'])

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

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

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

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

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

#create_assistant(create_assistant_request, opts = {}) ⇒ AssistantObject

Create an assistant with a model and instructions.

Parameters:

Returns:



93
94
95
96
# File 'lib/openapi_openai/api/assistants_api.rb', line 93

def create_assistant(create_assistant_request, opts = {})
  data, _status_code, _headers = create_assistant_with_http_info(create_assistant_request, opts)
  data
end

#create_assistant_file(assistant_id, create_assistant_file_request, opts = {}) ⇒ AssistantFileObject

Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants).

Parameters:

  • assistant_id (String)

    The ID of the assistant for which to create a File.

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

    the optional parameters

Returns:



160
161
162
163
# File 'lib/openapi_openai/api/assistants_api.rb', line 160

def create_assistant_file(assistant_id, create_assistant_file_request, opts = {})
  data, _status_code, _headers = create_assistant_file_with_http_info(assistant_id, create_assistant_file_request, opts)
  data
end

#create_assistant_file_with_http_info(assistant_id, create_assistant_file_request, opts = {}) ⇒ Array<(AssistantFileObject, Integer, Hash)>

Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants).

Parameters:

  • assistant_id (String)

    The ID of the assistant for which to create a File.

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

    the optional parameters

Returns:

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

    AssistantFileObject 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
218
219
220
221
222
223
224
225
# File 'lib/openapi_openai/api/assistants_api.rb', line 170

def create_assistant_file_with_http_info(assistant_id, create_assistant_file_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.create_assistant_file ...'
  end
  # verify the required parameter 'assistant_id' is set
  if @api_client.config.client_side_validation && assistant_id.nil?
    fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.create_assistant_file"
  end
  # verify the required parameter 'create_assistant_file_request' is set
  if @api_client.config.client_side_validation && create_assistant_file_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_assistant_file_request' when calling AssistantsApi.create_assistant_file"
  end
  # resource path
  local_var_path = '/assistants/{assistant_id}/files'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_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'])
  # 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_assistant_file_request)

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

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

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

#create_assistant_with_http_info(create_assistant_request, opts = {}) ⇒ Array<(AssistantObject, Integer, Hash)>

Create an assistant with a model and instructions.

Parameters:

Returns:

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

    AssistantObject data, response status code and response headers



102
103
104
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
# File 'lib/openapi_openai/api/assistants_api.rb', line 102

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

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

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

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

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

#create_message(thread_id, create_message_request, opts = {}) ⇒ MessageObject

Create a message.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) to create a message for.

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

    the optional parameters

Returns:



232
233
234
235
# File 'lib/openapi_openai/api/assistants_api.rb', line 232

def create_message(thread_id, create_message_request, opts = {})
  data, _status_code, _headers = create_message_with_http_info(thread_id, create_message_request, opts)
  data
end

#create_message_with_http_info(thread_id, create_message_request, opts = {}) ⇒ Array<(MessageObject, Integer, Hash)>

Create a message.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) to create a message for.

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

    the optional parameters

Returns:

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

    MessageObject data, response status code and response headers



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/openapi_openai/api/assistants_api.rb', line 242

def create_message_with_http_info(thread_id, create_message_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.create_message ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.create_message"
  end
  # verify the required parameter 'create_message_request' is set
  if @api_client.config.client_side_validation && create_message_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_message_request' when calling AssistantsApi.create_message"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/messages'.sub('{' + 'thread_id' + '}', CGI.escape(thread_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'])
  # 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_message_request)

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

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

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

#create_run(thread_id, create_run_request, opts = {}) ⇒ RunObject

Create a run.

Parameters:

  • thread_id (String)

    The ID of the thread to run.

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

    the optional parameters

Returns:



304
305
306
307
# File 'lib/openapi_openai/api/assistants_api.rb', line 304

def create_run(thread_id, create_run_request, opts = {})
  data, _status_code, _headers = create_run_with_http_info(thread_id, create_run_request, opts)
  data
end

#create_run_with_http_info(thread_id, create_run_request, opts = {}) ⇒ Array<(RunObject, Integer, Hash)>

Create a run.

Parameters:

  • thread_id (String)

    The ID of the thread to run.

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

    the optional parameters

Returns:

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

    RunObject data, response status code and response headers



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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/openapi_openai/api/assistants_api.rb', line 314

def create_run_with_http_info(thread_id, create_run_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.create_run ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.create_run"
  end
  # verify the required parameter 'create_run_request' is set
  if @api_client.config.client_side_validation && create_run_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_run_request' when calling AssistantsApi.create_run"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/runs'.sub('{' + 'thread_id' + '}', CGI.escape(thread_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'])
  # 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_run_request)

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

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

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

#create_thread(opts = {}) ⇒ ThreadObject

Create a thread.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



375
376
377
378
# File 'lib/openapi_openai/api/assistants_api.rb', line 375

def create_thread(opts = {})
  data, _status_code, _headers = create_thread_with_http_info(opts)
  data
end

#create_thread_and_run(create_thread_and_run_request, opts = {}) ⇒ RunObject

Create a thread and run it in one request.

Parameters:

Returns:



437
438
439
440
# File 'lib/openapi_openai/api/assistants_api.rb', line 437

def create_thread_and_run(create_thread_and_run_request, opts = {})
  data, _status_code, _headers = create_thread_and_run_with_http_info(create_thread_and_run_request, opts)
  data
end

#create_thread_and_run_with_http_info(create_thread_and_run_request, opts = {}) ⇒ Array<(RunObject, Integer, Hash)>

Create a thread and run it in one request.

Parameters:

Returns:

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

    RunObject data, response status code and response headers



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
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/openapi_openai/api/assistants_api.rb', line 446

def create_thread_and_run_with_http_info(create_thread_and_run_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.create_thread_and_run ...'
  end
  # verify the required parameter 'create_thread_and_run_request' is set
  if @api_client.config.client_side_validation && create_thread_and_run_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_thread_and_run_request' when calling AssistantsApi.create_thread_and_run"
  end
  # resource path
  local_var_path = '/threads/runs'

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

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

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

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

#create_thread_with_http_info(opts = {}) ⇒ Array<(ThreadObject, Integer, Hash)>

Create a thread.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    ThreadObject data, response status code and response headers



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/openapi_openai/api/assistants_api.rb', line 384

def create_thread_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.create_thread ...'
  end
  # resource path
  local_var_path = '/threads'

  # 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'])
  # 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[:'create_thread_request'])

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

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

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

#delete_assistant(assistant_id, opts = {}) ⇒ DeleteAssistantResponse

Delete an assistant.

Parameters:

  • assistant_id (String)

    The ID of the assistant to delete.

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

    the optional parameters

Returns:



503
504
505
506
# File 'lib/openapi_openai/api/assistants_api.rb', line 503

def delete_assistant(assistant_id, opts = {})
  data, _status_code, _headers = delete_assistant_with_http_info(assistant_id, opts)
  data
end

#delete_assistant_file(assistant_id, file_id, opts = {}) ⇒ DeleteAssistantFileResponse

Delete an assistant file.

Parameters:

  • assistant_id (String)

    The ID of the assistant that the file belongs to.

  • file_id (String)

    The ID of the file to delete.

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

    the optional parameters

Returns:



565
566
567
568
# File 'lib/openapi_openai/api/assistants_api.rb', line 565

def delete_assistant_file(assistant_id, file_id, opts = {})
  data, _status_code, _headers = delete_assistant_file_with_http_info(assistant_id, file_id, opts)
  data
end

#delete_assistant_file_with_http_info(assistant_id, file_id, opts = {}) ⇒ Array<(DeleteAssistantFileResponse, Integer, Hash)>

Delete an assistant file.

Parameters:

  • assistant_id (String)

    The ID of the assistant that the file belongs to.

  • file_id (String)

    The ID of the file to delete.

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

    the optional parameters

Returns:

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

    DeleteAssistantFileResponse data, response status code and response headers



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
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/openapi_openai/api/assistants_api.rb', line 575

def delete_assistant_file_with_http_info(assistant_id, file_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.delete_assistant_file ...'
  end
  # verify the required parameter 'assistant_id' is set
  if @api_client.config.client_side_validation && assistant_id.nil?
    fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.delete_assistant_file"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling AssistantsApi.delete_assistant_file"
  end
  # resource path
  local_var_path = '/assistants/{assistant_id}/files/{file_id}'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s)).sub('{' + 'file_id' + '}', CGI.escape(file_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'])

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

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

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

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

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

#delete_assistant_with_http_info(assistant_id, opts = {}) ⇒ Array<(DeleteAssistantResponse, Integer, Hash)>

Delete an assistant.

Parameters:

  • assistant_id (String)

    The ID of the assistant to delete.

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

    the optional parameters

Returns:

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

    DeleteAssistantResponse data, response status code and response headers



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
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/openapi_openai/api/assistants_api.rb', line 512

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

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

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

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

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

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

#delete_thread(thread_id, opts = {}) ⇒ DeleteThreadResponse

Delete a thread.

Parameters:

  • thread_id (String)

    The ID of the thread to delete.

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

    the optional parameters

Returns:



631
632
633
634
# File 'lib/openapi_openai/api/assistants_api.rb', line 631

def delete_thread(thread_id, opts = {})
  data, _status_code, _headers = delete_thread_with_http_info(thread_id, opts)
  data
end

#delete_thread_with_http_info(thread_id, opts = {}) ⇒ Array<(DeleteThreadResponse, Integer, Hash)>

Delete a thread.

Parameters:

  • thread_id (String)

    The ID of the thread to delete.

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

    the optional parameters

Returns:

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

    DeleteThreadResponse data, response status code and response headers



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
683
684
685
686
# File 'lib/openapi_openai/api/assistants_api.rb', line 640

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

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

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

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

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

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

#get_assistant(assistant_id, opts = {}) ⇒ AssistantObject

Retrieves an assistant.

Parameters:

  • assistant_id (String)

    The ID of the assistant to retrieve.

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

    the optional parameters

Returns:



692
693
694
695
# File 'lib/openapi_openai/api/assistants_api.rb', line 692

def get_assistant(assistant_id, opts = {})
  data, _status_code, _headers = get_assistant_with_http_info(assistant_id, opts)
  data
end

#get_assistant_file(assistant_id, file_id, opts = {}) ⇒ AssistantFileObject

Retrieves an AssistantFile.

Parameters:

  • assistant_id (String)

    The ID of the assistant who the file belongs to.

  • file_id (String)

    The ID of the file we&#39;re getting.

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

    the optional parameters

Returns:



754
755
756
757
# File 'lib/openapi_openai/api/assistants_api.rb', line 754

def get_assistant_file(assistant_id, file_id, opts = {})
  data, _status_code, _headers = get_assistant_file_with_http_info(assistant_id, file_id, opts)
  data
end

#get_assistant_file_with_http_info(assistant_id, file_id, opts = {}) ⇒ Array<(AssistantFileObject, Integer, Hash)>

Retrieves an AssistantFile.

Parameters:

  • assistant_id (String)

    The ID of the assistant who the file belongs to.

  • file_id (String)

    The ID of the file we&#39;re getting.

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

    the optional parameters

Returns:

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

    AssistantFileObject data, response status code and response headers



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
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
# File 'lib/openapi_openai/api/assistants_api.rb', line 764

def get_assistant_file_with_http_info(assistant_id, file_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.get_assistant_file ...'
  end
  # verify the required parameter 'assistant_id' is set
  if @api_client.config.client_side_validation && assistant_id.nil?
    fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.get_assistant_file"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling AssistantsApi.get_assistant_file"
  end
  # resource path
  local_var_path = '/assistants/{assistant_id}/files/{file_id}'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s)).sub('{' + 'file_id' + '}', CGI.escape(file_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'])

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

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

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

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

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

#get_assistant_with_http_info(assistant_id, opts = {}) ⇒ Array<(AssistantObject, Integer, Hash)>

Retrieves an assistant.

Parameters:

  • assistant_id (String)

    The ID of the assistant to retrieve.

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

    the optional parameters

Returns:

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

    AssistantObject data, response status code and response headers



701
702
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
# File 'lib/openapi_openai/api/assistants_api.rb', line 701

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

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

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

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

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

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

#get_message(thread_id, message_id, opts = {}) ⇒ MessageObject

Retrieve a message.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) to which this message belongs.

  • message_id (String)

    The ID of the message to retrieve.

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

    the optional parameters

Returns:



821
822
823
824
# File 'lib/openapi_openai/api/assistants_api.rb', line 821

def get_message(thread_id, message_id, opts = {})
  data, _status_code, _headers = get_message_with_http_info(thread_id, message_id, opts)
  data
end

#get_message_file(thread_id, message_id, file_id, opts = {}) ⇒ MessageFileObject

Retrieves a message file.

Parameters:

  • thread_id (String)

    The ID of the thread to which the message and File belong.

  • message_id (String)

    The ID of the message the file belongs to.

  • file_id (String)

    The ID of the file being retrieved.

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

    the optional parameters

Returns:



889
890
891
892
# File 'lib/openapi_openai/api/assistants_api.rb', line 889

def get_message_file(thread_id, message_id, file_id, opts = {})
  data, _status_code, _headers = get_message_file_with_http_info(thread_id, message_id, file_id, opts)
  data
end

#get_message_file_with_http_info(thread_id, message_id, file_id, opts = {}) ⇒ Array<(MessageFileObject, Integer, Hash)>

Retrieves a message file.

Parameters:

  • thread_id (String)

    The ID of the thread to which the message and File belong.

  • message_id (String)

    The ID of the message the file belongs to.

  • file_id (String)

    The ID of the file being retrieved.

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

    the optional parameters

Returns:

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

    MessageFileObject data, response status code and response headers



900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
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
# File 'lib/openapi_openai/api/assistants_api.rb', line 900

def get_message_file_with_http_info(thread_id, message_id, file_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.get_message_file ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_message_file"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling AssistantsApi.get_message_file"
  end
  # verify the required parameter 'file_id' is set
  if @api_client.config.client_side_validation && file_id.nil?
    fail ArgumentError, "Missing the required parameter 'file_id' when calling AssistantsApi.get_message_file"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/messages/{message_id}/files/{file_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'message_id' + '}', CGI.escape(message_id.to_s)).sub('{' + 'file_id' + '}', CGI.escape(file_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'])

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

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

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

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

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

#get_message_with_http_info(thread_id, message_id, opts = {}) ⇒ Array<(MessageObject, Integer, Hash)>

Retrieve a message.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) to which this message belongs.

  • message_id (String)

    The ID of the message to retrieve.

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

    the optional parameters

Returns:

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

    MessageObject data, response status code and response headers



831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
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
# File 'lib/openapi_openai/api/assistants_api.rb', line 831

def get_message_with_http_info(thread_id, message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.get_message ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_message"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling AssistantsApi.get_message"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/messages/{message_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'message_id' + '}', CGI.escape(message_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'])

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

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

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

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

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

#get_run(thread_id, run_id, opts = {}) ⇒ RunObject

Retrieves a run.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) that was run.

  • run_id (String)

    The ID of the run to retrieve.

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

    the optional parameters

Returns:



961
962
963
964
# File 'lib/openapi_openai/api/assistants_api.rb', line 961

def get_run(thread_id, run_id, opts = {})
  data, _status_code, _headers = get_run_with_http_info(thread_id, run_id, opts)
  data
end

#get_run_step(thread_id, run_id, step_id, opts = {}) ⇒ RunStepObject

Retrieves a run step.

Parameters:

  • thread_id (String)

    The ID of the thread to which the run and run step belongs.

  • run_id (String)

    The ID of the run to which the run step belongs.

  • step_id (String)

    The ID of the run step to retrieve.

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

    the optional parameters

Returns:



1029
1030
1031
1032
# File 'lib/openapi_openai/api/assistants_api.rb', line 1029

def get_run_step(thread_id, run_id, step_id, opts = {})
  data, _status_code, _headers = get_run_step_with_http_info(thread_id, run_id, step_id, opts)
  data
end

#get_run_step_with_http_info(thread_id, run_id, step_id, opts = {}) ⇒ Array<(RunStepObject, Integer, Hash)>

Retrieves a run step.

Parameters:

  • thread_id (String)

    The ID of the thread to which the run and run step belongs.

  • run_id (String)

    The ID of the run to which the run step belongs.

  • step_id (String)

    The ID of the run step to retrieve.

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

    the optional parameters

Returns:

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

    RunStepObject data, response status code and response headers



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
1094
# File 'lib/openapi_openai/api/assistants_api.rb', line 1040

def get_run_step_with_http_info(thread_id, run_id, step_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.get_run_step ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_run_step"
  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 AssistantsApi.get_run_step"
  end
  # verify the required parameter 'step_id' is set
  if @api_client.config.client_side_validation && step_id.nil?
    fail ArgumentError, "Missing the required parameter 'step_id' when calling AssistantsApi.get_run_step"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/runs/{run_id}/steps/{step_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', CGI.escape(run_id.to_s)).sub('{' + 'step_id' + '}', CGI.escape(step_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'])

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

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

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

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

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

#get_run_with_http_info(thread_id, run_id, opts = {}) ⇒ Array<(RunObject, Integer, Hash)>

Retrieves a run.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) that was run.

  • run_id (String)

    The ID of the run to retrieve.

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

    the optional parameters

Returns:

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

    RunObject data, response status code and response headers



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
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
# File 'lib/openapi_openai/api/assistants_api.rb', line 971

def get_run_with_http_info(thread_id, run_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.get_run ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.get_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 AssistantsApi.get_run"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/runs/{run_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', 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'])

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

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

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

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

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

#get_thread(thread_id, opts = {}) ⇒ ThreadObject

Retrieves a thread.

Parameters:

  • thread_id (String)

    The ID of the thread to retrieve.

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

    the optional parameters

Returns:



1100
1101
1102
1103
# File 'lib/openapi_openai/api/assistants_api.rb', line 1100

def get_thread(thread_id, opts = {})
  data, _status_code, _headers = get_thread_with_http_info(thread_id, opts)
  data
end

#get_thread_with_http_info(thread_id, opts = {}) ⇒ Array<(ThreadObject, Integer, Hash)>

Retrieves a thread.

Parameters:

  • thread_id (String)

    The ID of the thread to retrieve.

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

    the optional parameters

Returns:

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

    ThreadObject data, response status code and response headers



1109
1110
1111
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
# File 'lib/openapi_openai/api/assistants_api.rb', line 1109

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

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

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

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

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

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

#list_assistant_files(assistant_id, opts = {}) ⇒ ListAssistantFilesResponse

Returns a list of assistant files.

Parameters:

  • assistant_id (String)

    The ID of the assistant the file belongs to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:



1165
1166
1167
1168
# File 'lib/openapi_openai/api/assistants_api.rb', line 1165

def list_assistant_files(assistant_id, opts = {})
  data, _status_code, _headers = list_assistant_files_with_http_info(assistant_id, opts)
  data
end

#list_assistant_files_with_http_info(assistant_id, opts = {}) ⇒ Array<(ListAssistantFilesResponse, Integer, Hash)>

Returns a list of assistant files.

Parameters:

  • assistant_id (String)

    The ID of the assistant the file belongs to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:

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

    ListAssistantFilesResponse data, response status code and response headers



1178
1179
1180
1181
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/openapi_openai/api/assistants_api.rb', line 1178

def list_assistant_files_with_http_info(assistant_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.list_assistant_files ...'
  end
  # verify the required parameter 'assistant_id' is set
  if @api_client.config.client_side_validation && assistant_id.nil?
    fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.list_assistant_files"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/assistants/{assistant_id}/files'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

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

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

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

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

#list_assistants(opts = {}) ⇒ ListAssistantsResponse

Returns a list of assistants.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:



1241
1242
1243
1244
# File 'lib/openapi_openai/api/assistants_api.rb', line 1241

def list_assistants(opts = {})
  data, _status_code, _headers = list_assistants_with_http_info(opts)
  data
end

#list_assistants_with_http_info(opts = {}) ⇒ Array<(ListAssistantsResponse, Integer, Hash)>

Returns a list of assistants.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:

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

    ListAssistantsResponse 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
# File 'lib/openapi_openai/api/assistants_api.rb', line 1253

def list_assistants_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.list_assistants ...'
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/assistants'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

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

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

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

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

#list_message_files(thread_id, message_id, opts = {}) ⇒ ListMessageFilesResponse

Returns a list of message files.

Parameters:

  • thread_id (String)

    The ID of the thread that the message and files belong to.

  • message_id (String)

    The ID of the message that the files belongs to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:



1314
1315
1316
1317
# File 'lib/openapi_openai/api/assistants_api.rb', line 1314

def list_message_files(thread_id, message_id, opts = {})
  data, _status_code, _headers = list_message_files_with_http_info(thread_id, message_id, opts)
  data
end

#list_message_files_with_http_info(thread_id, message_id, opts = {}) ⇒ Array<(ListMessageFilesResponse, Integer, Hash)>

Returns a list of message files.

Parameters:

  • thread_id (String)

    The ID of the thread that the message and files belong to.

  • message_id (String)

    The ID of the message that the files belongs to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:

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

    ListMessageFilesResponse data, response status code and response headers



1328
1329
1330
1331
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
1383
1384
1385
1386
# File 'lib/openapi_openai/api/assistants_api.rb', line 1328

def list_message_files_with_http_info(thread_id, message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.list_message_files ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.list_message_files"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling AssistantsApi.list_message_files"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/messages/{message_id}/files'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'message_id' + '}', CGI.escape(message_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

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

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

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

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

#list_messages(thread_id, opts = {}) ⇒ ListMessagesResponse

Returns a list of messages for a given thread.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) the messages belong to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

  • :run_id (String)

    Filter messages by the run ID that generated them.

Returns:



1397
1398
1399
1400
# File 'lib/openapi_openai/api/assistants_api.rb', line 1397

def list_messages(thread_id, opts = {})
  data, _status_code, _headers = list_messages_with_http_info(thread_id, opts)
  data
end

#list_messages_with_http_info(thread_id, opts = {}) ⇒ Array<(ListMessagesResponse, Integer, Hash)>

Returns a list of messages for a given thread.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) the messages belong to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

  • :run_id (String)

    Filter messages by the run ID that generated them.

Returns:

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

    ListMessagesResponse data, response status code and response headers



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
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
# File 'lib/openapi_openai/api/assistants_api.rb', line 1411

def list_messages_with_http_info(thread_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.list_messages ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.list_messages"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/messages'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'run_id'] = opts[:'run_id'] if !opts[:'run_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

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

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

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

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

#list_run_steps(thread_id, run_id, opts = {}) ⇒ ListRunStepsResponse

Returns a list of run steps belonging to a run.

Parameters:

  • thread_id (String)

    The ID of the thread the run and run steps belong to.

  • run_id (String)

    The ID of the run the run steps belong to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:



1477
1478
1479
1480
# File 'lib/openapi_openai/api/assistants_api.rb', line 1477

def list_run_steps(thread_id, run_id, opts = {})
  data, _status_code, _headers = list_run_steps_with_http_info(thread_id, run_id, opts)
  data
end

#list_run_steps_with_http_info(thread_id, run_id, opts = {}) ⇒ Array<(ListRunStepsResponse, Integer, Hash)>

Returns a list of run steps belonging to a run.

Parameters:

  • thread_id (String)

    The ID of the thread the run and run steps belong to.

  • run_id (String)

    The ID of the run the run steps belong to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:

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

    ListRunStepsResponse data, response status code and response headers



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
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
# File 'lib/openapi_openai/api/assistants_api.rb', line 1491

def list_run_steps_with_http_info(thread_id, run_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.list_run_steps ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.list_run_steps"
  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 AssistantsApi.list_run_steps"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/runs/{run_id}/steps'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', CGI.escape(run_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

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

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

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

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

#list_runs(thread_id, opts = {}) ⇒ ListRunsResponse

Returns a list of runs belonging to a thread.

Parameters:

  • thread_id (String)

    The ID of the thread the run belongs to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:



1559
1560
1561
1562
# File 'lib/openapi_openai/api/assistants_api.rb', line 1559

def list_runs(thread_id, opts = {})
  data, _status_code, _headers = list_runs_with_http_info(thread_id, opts)
  data
end

#list_runs_with_http_info(thread_id, opts = {}) ⇒ Array<(ListRunsResponse, Integer, Hash)>

Returns a list of runs belonging to a thread.

Parameters:

  • thread_id (String)

    The ID of the thread the run belongs to.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (default to 20)

  • :order (String)

    Sort order by the &#x60;created_at&#x60; timestamp of the objects. &#x60;asc&#x60; for ascending order and &#x60;desc&#x60; for descending order. (default to ‘desc’)

  • :after (String)

    A cursor for use in pagination. &#x60;after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after&#x3D;obj_foo in order to fetch the next page of the list.

  • :before (String)

    A cursor for use in pagination. &#x60;before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before&#x3D;obj_foo in order to fetch the previous page of the list.

Returns:

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

    ListRunsResponse data, response status code and response headers



1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
# File 'lib/openapi_openai/api/assistants_api.rb', line 1572

def list_runs_with_http_info(thread_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.list_runs ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.list_runs"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/runs'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

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

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

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

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

#modify_assistant(assistant_id, modify_assistant_request, opts = {}) ⇒ AssistantObject

Modifies an assistant.

Parameters:

  • assistant_id (String)

    The ID of the assistant to modify.

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

    the optional parameters

Returns:



1633
1634
1635
1636
# File 'lib/openapi_openai/api/assistants_api.rb', line 1633

def modify_assistant(assistant_id, modify_assistant_request, opts = {})
  data, _status_code, _headers = modify_assistant_with_http_info(assistant_id, modify_assistant_request, opts)
  data
end

#modify_assistant_with_http_info(assistant_id, modify_assistant_request, opts = {}) ⇒ Array<(AssistantObject, Integer, Hash)>

Modifies an assistant.

Parameters:

  • assistant_id (String)

    The ID of the assistant to modify.

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

    the optional parameters

Returns:

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

    AssistantObject data, response status code and response headers



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
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
# File 'lib/openapi_openai/api/assistants_api.rb', line 1643

def modify_assistant_with_http_info(assistant_id, modify_assistant_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.modify_assistant ...'
  end
  # verify the required parameter 'assistant_id' is set
  if @api_client.config.client_side_validation && assistant_id.nil?
    fail ArgumentError, "Missing the required parameter 'assistant_id' when calling AssistantsApi.modify_assistant"
  end
  # verify the required parameter 'modify_assistant_request' is set
  if @api_client.config.client_side_validation && modify_assistant_request.nil?
    fail ArgumentError, "Missing the required parameter 'modify_assistant_request' when calling AssistantsApi.modify_assistant"
  end
  # resource path
  local_var_path = '/assistants/{assistant_id}'.sub('{' + 'assistant_id' + '}', CGI.escape(assistant_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'])
  # 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(modify_assistant_request)

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

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

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

#modify_message(thread_id, message_id, modify_message_request, opts = {}) ⇒ MessageObject

Modifies a message.

Parameters:

  • thread_id (String)

    The ID of the thread to which this message belongs.

  • message_id (String)

    The ID of the message to modify.

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

    the optional parameters

Returns:



1706
1707
1708
1709
# File 'lib/openapi_openai/api/assistants_api.rb', line 1706

def modify_message(thread_id, message_id, modify_message_request, opts = {})
  data, _status_code, _headers = modify_message_with_http_info(thread_id, message_id, modify_message_request, opts)
  data
end

#modify_message_with_http_info(thread_id, message_id, modify_message_request, opts = {}) ⇒ Array<(MessageObject, Integer, Hash)>

Modifies a message.

Parameters:

  • thread_id (String)

    The ID of the thread to which this message belongs.

  • message_id (String)

    The ID of the message to modify.

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

    the optional parameters

Returns:

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

    MessageObject data, response status code and response headers



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
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
# File 'lib/openapi_openai/api/assistants_api.rb', line 1717

def modify_message_with_http_info(thread_id, message_id, modify_message_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.modify_message ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.modify_message"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling AssistantsApi.modify_message"
  end
  # verify the required parameter 'modify_message_request' is set
  if @api_client.config.client_side_validation && modify_message_request.nil?
    fail ArgumentError, "Missing the required parameter 'modify_message_request' when calling AssistantsApi.modify_message"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/messages/{message_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'message_id' + '}', CGI.escape(message_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'])
  # 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(modify_message_request)

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

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

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

#modify_run(thread_id, run_id, modify_run_request, opts = {}) ⇒ RunObject

Modifies a run.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) that was run.

  • run_id (String)

    The ID of the run to modify.

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

    the optional parameters

Returns:



1784
1785
1786
1787
# File 'lib/openapi_openai/api/assistants_api.rb', line 1784

def modify_run(thread_id, run_id, modify_run_request, opts = {})
  data, _status_code, _headers = modify_run_with_http_info(thread_id, run_id, modify_run_request, opts)
  data
end

#modify_run_with_http_info(thread_id, run_id, modify_run_request, opts = {}) ⇒ Array<(RunObject, Integer, Hash)>

Modifies a run.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) that was run.

  • run_id (String)

    The ID of the run to modify.

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

    the optional parameters

Returns:

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

    RunObject data, response status code and response headers



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
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
# File 'lib/openapi_openai/api/assistants_api.rb', line 1795

def modify_run_with_http_info(thread_id, run_id, modify_run_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.modify_run ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.modify_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 AssistantsApi.modify_run"
  end
  # verify the required parameter 'modify_run_request' is set
  if @api_client.config.client_side_validation && modify_run_request.nil?
    fail ArgumentError, "Missing the required parameter 'modify_run_request' when calling AssistantsApi.modify_run"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/runs/{run_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', 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'])
  # 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(modify_run_request)

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

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

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

#modify_thread(thread_id, modify_thread_request, opts = {}) ⇒ ThreadObject

Modifies a thread.

Parameters:

  • thread_id (String)

    The ID of the thread to modify. Only the &#x60;metadata&#x60; can be modified.

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

    the optional parameters

Returns:



1861
1862
1863
1864
# File 'lib/openapi_openai/api/assistants_api.rb', line 1861

def modify_thread(thread_id, modify_thread_request, opts = {})
  data, _status_code, _headers = modify_thread_with_http_info(thread_id, modify_thread_request, opts)
  data
end

#modify_thread_with_http_info(thread_id, modify_thread_request, opts = {}) ⇒ Array<(ThreadObject, Integer, Hash)>

Modifies a thread.

Parameters:

  • thread_id (String)

    The ID of the thread to modify. Only the &#x60;metadata&#x60; can be modified.

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

    the optional parameters

Returns:

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

    ThreadObject data, response status code and response headers



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
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
# File 'lib/openapi_openai/api/assistants_api.rb', line 1871

def modify_thread_with_http_info(thread_id, modify_thread_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.modify_thread ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.modify_thread"
  end
  # verify the required parameter 'modify_thread_request' is set
  if @api_client.config.client_side_validation && modify_thread_request.nil?
    fail ArgumentError, "Missing the required parameter 'modify_thread_request' when calling AssistantsApi.modify_thread"
  end
  # resource path
  local_var_path = '/threads/{thread_id}'.sub('{' + 'thread_id' + '}', CGI.escape(thread_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'])
  # 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(modify_thread_request)

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

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

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

#submit_tool_ouputs_to_run(thread_id, run_id, submit_tool_outputs_run_request, opts = {}) ⇒ RunObject

When a run has the ‘status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they’re all completed. All outputs must be submitted in a single request.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) to which this run belongs.

  • run_id (String)

    The ID of the run that requires the tool output submission.

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

    the optional parameters

Returns:



1934
1935
1936
1937
# File 'lib/openapi_openai/api/assistants_api.rb', line 1934

def submit_tool_ouputs_to_run(thread_id, run_id, submit_tool_outputs_run_request, opts = {})
  data, _status_code, _headers = submit_tool_ouputs_to_run_with_http_info(thread_id, run_id, submit_tool_outputs_run_request, opts)
  data
end

#submit_tool_ouputs_to_run_with_http_info(thread_id, run_id, submit_tool_outputs_run_request, opts = {}) ⇒ Array<(RunObject, Integer, Hash)>

When a run has the &#x60;status: &quot;requires_action&quot;&#x60; and &#x60;required_action.type&#x60; is &#x60;submit_tool_outputs&#x60;, this endpoint can be used to submit the outputs from the tool calls once they&#39;re all completed. All outputs must be submitted in a single request.

Parameters:

  • thread_id (String)

    The ID of the [thread](/docs/api-reference/threads) to which this run belongs.

  • run_id (String)

    The ID of the run that requires the tool output submission.

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

    the optional parameters

Returns:

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

    RunObject data, response status code and response headers



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
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
# File 'lib/openapi_openai/api/assistants_api.rb', line 1945

def submit_tool_ouputs_to_run_with_http_info(thread_id, run_id, submit_tool_outputs_run_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AssistantsApi.submit_tool_ouputs_to_run ...'
  end
  # verify the required parameter 'thread_id' is set
  if @api_client.config.client_side_validation && thread_id.nil?
    fail ArgumentError, "Missing the required parameter 'thread_id' when calling AssistantsApi.submit_tool_ouputs_to_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 AssistantsApi.submit_tool_ouputs_to_run"
  end
  # verify the required parameter 'submit_tool_outputs_run_request' is set
  if @api_client.config.client_side_validation && submit_tool_outputs_run_request.nil?
    fail ArgumentError, "Missing the required parameter 'submit_tool_outputs_run_request' when calling AssistantsApi.submit_tool_ouputs_to_run"
  end
  # resource path
  local_var_path = '/threads/{thread_id}/runs/{run_id}/submit_tool_outputs'.sub('{' + 'thread_id' + '}', CGI.escape(thread_id.to_s)).sub('{' + 'run_id' + '}', 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'])
  # 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(submit_tool_outputs_run_request)

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

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

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