Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Latest commit

 

History

History
1943 lines (1400 loc) · 64.4 KB

AssistantsApi.md

File metadata and controls

1943 lines (1400 loc) · 64.4 KB

OpenapiClient::AssistantsApi

All URIs are relative to https://api.openai.com/v1

Method HTTP request Description
cancel_run POST /threads/{thread_id}/runs/{run_id}/cancel Cancels a run that is `in_progress`.
create_assistant POST /assistants Create an assistant with a model and instructions.
create_assistant_file POST /assistants/{assistant_id}/files Create an assistant file by attaching a File to an assistant.
create_message POST /threads/{thread_id}/messages Create a message.
create_run POST /threads/{thread_id}/runs Create a run.
create_thread POST /threads Create a thread.
create_thread_and_run POST /threads/runs Create a thread and run it in one request.
delete_assistant DELETE /assistants/{assistant_id} Delete an assistant.
delete_assistant_file DELETE /assistants/{assistant_id}/files/{file_id} Delete an assistant file.
delete_thread DELETE /threads/{thread_id} Delete a thread.
get_assistant GET /assistants/{assistant_id} Retrieves an assistant.
get_assistant_file GET /assistants/{assistant_id}/files/{file_id} Retrieves an AssistantFile.
get_message GET /threads/{thread_id}/messages/{message_id} Retrieve a message.
get_message_file GET /threads/{thread_id}/messages/{message_id}/files/{file_id} Retrieves a message file.
get_run GET /threads/{thread_id}/runs/{run_id} Retrieves a run.
get_run_step GET /threads/{thread_id}/runs/{run_id}/steps/{step_id} Retrieves a run step.
get_thread GET /threads/{thread_id} Retrieves a thread.
list_assistant_files GET /assistants/{assistant_id}/files Returns a list of assistant files.
list_assistants GET /assistants Returns a list of assistants.
list_message_files GET /threads/{thread_id}/messages/{message_id}/files Returns a list of message files.
list_messages GET /threads/{thread_id}/messages Returns a list of messages for a given thread.
list_run_steps GET /threads/{thread_id}/runs/{run_id}/steps Returns a list of run steps belonging to a run.
list_runs GET /threads/{thread_id}/runs Returns a list of runs belonging to a thread.
modify_message POST /threads/{thread_id}/messages/{message_id} Modifies a message.
modify_run POST /threads/{thread_id}/runs/{run_id} Modifies a run.
modify_thread POST /threads/{thread_id} Modifies a thread.
submit_tool_ouputs_to_run POST /threads/{thread_id}/runs/{run_id}/submit_tool_outputs 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.

cancel_run

cancel_run(thread_id, run_id)

Cancels a run that is in_progress.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread to which this run belongs.
run_id = 'run_id_example' # String | The ID of the run to cancel.

begin
  # Cancels a run that is `in_progress`.
  result = api_instance.cancel_run(thread_id, run_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->cancel_run: #{e}"
end

Using the cancel_run_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> cancel_run_with_http_info(thread_id, run_id)

begin
  # Cancels a run that is `in_progress`.
  data, status_code, headers = api_instance.cancel_run_with_http_info(thread_id, run_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RunObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->cancel_run_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread to which this run belongs.
run_id String The ID of the run to cancel.

Return type

RunObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

create_assistant

create_assistant(create_assistant_request)

Create an assistant with a model and instructions.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
create_assistant_request = OpenapiClient::CreateAssistantRequest.new({model: 'model_example'}) # CreateAssistantRequest | 

begin
  # Create an assistant with a model and instructions.
  result = api_instance.create_assistant(create_assistant_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_assistant: #{e}"
end

Using the create_assistant_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_assistant_with_http_info(create_assistant_request)

begin
  # Create an assistant with a model and instructions.
  data, status_code, headers = api_instance.create_assistant_with_http_info(create_assistant_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <AssistantObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_assistant_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_assistant_request CreateAssistantRequest

Return type

AssistantObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_assistant_file

create_assistant_file(assistant_id, create_assistant_file_request)

Create an assistant file by attaching a File to an assistant.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
assistant_id = 'file-AF1WoRqd3aJAHsqc9NY7iL8F' # String | The ID of the assistant for which to create a File. 
create_assistant_file_request = OpenapiClient::CreateAssistantFileRequest.new({file_id: 'file_id_example'}) # CreateAssistantFileRequest | 

begin
  # Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants).
  result = api_instance.create_assistant_file(assistant_id, create_assistant_file_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_assistant_file: #{e}"
end

Using the create_assistant_file_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_assistant_file_with_http_info(assistant_id, create_assistant_file_request)

begin
  # Create an assistant file by attaching a [File](/docs/api-reference/files) to an [assistant](/docs/api-reference/assistants).
  data, status_code, headers = api_instance.create_assistant_file_with_http_info(assistant_id, create_assistant_file_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <AssistantFileObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_assistant_file_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
assistant_id String The ID of the assistant for which to create a File.
create_assistant_file_request CreateAssistantFileRequest

Return type

AssistantFileObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_message

create_message(thread_id, create_message_request)

Create a message.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the [thread](/docs/api-reference/threads) to create a message for.
create_message_request = OpenapiClient::CreateMessageRequest.new({role: 'user', content: 'content_example'}) # CreateMessageRequest | 

begin
  # Create a message.
  result = api_instance.create_message(thread_id, create_message_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_message: #{e}"
end

Using the create_message_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_message_with_http_info(thread_id, create_message_request)

begin
  # Create a message.
  data, status_code, headers = api_instance.create_message_with_http_info(thread_id, create_message_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <MessageObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_message_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread to create a message for.
create_message_request CreateMessageRequest

Return type

MessageObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_run

create_run(thread_id, create_run_request)

Create a run.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread to run.
create_run_request = OpenapiClient::CreateRunRequest.new({assistant_id: 'assistant_id_example'}) # CreateRunRequest | 

begin
  # Create a run.
  result = api_instance.create_run(thread_id, create_run_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_run: #{e}"
end

Using the create_run_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_run_with_http_info(thread_id, create_run_request)

begin
  # Create a run.
  data, status_code, headers = api_instance.create_run_with_http_info(thread_id, create_run_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RunObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_run_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread to run.
create_run_request CreateRunRequest

Return type

RunObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_thread

create_thread(create_thread_request)

Create a thread.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
create_thread_request = OpenapiClient::CreateThreadRequest.new # CreateThreadRequest | 

begin
  # Create a thread.
  result = api_instance.create_thread(create_thread_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_thread: #{e}"
end

Using the create_thread_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_thread_with_http_info(create_thread_request)

begin
  # Create a thread.
  data, status_code, headers = api_instance.create_thread_with_http_info(create_thread_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ThreadObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_thread_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_thread_request CreateThreadRequest

Return type

ThreadObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_thread_and_run

create_thread_and_run(create_thread_and_run_request)

Create a thread and run it in one request.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
create_thread_and_run_request = OpenapiClient::CreateThreadAndRunRequest.new({assistant_id: 'assistant_id_example'}) # CreateThreadAndRunRequest | 

begin
  # Create a thread and run it in one request.
  result = api_instance.create_thread_and_run(create_thread_and_run_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_thread_and_run: #{e}"
end

Using the create_thread_and_run_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_thread_and_run_with_http_info(create_thread_and_run_request)

begin
  # Create a thread and run it in one request.
  data, status_code, headers = api_instance.create_thread_and_run_with_http_info(create_thread_and_run_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RunObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->create_thread_and_run_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_thread_and_run_request CreateThreadAndRunRequest

Return type

RunObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

delete_assistant

delete_assistant(assistant_id)

Delete an assistant.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
assistant_id = 'assistant_id_example' # String | The ID of the assistant to delete.

begin
  # Delete an assistant.
  result = api_instance.delete_assistant(assistant_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->delete_assistant: #{e}"
end

Using the delete_assistant_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> delete_assistant_with_http_info(assistant_id)

begin
  # Delete an assistant.
  data, status_code, headers = api_instance.delete_assistant_with_http_info(assistant_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeleteAssistantResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->delete_assistant_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
assistant_id String The ID of the assistant to delete.

Return type

DeleteAssistantResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

delete_assistant_file

delete_assistant_file(assistant_id, file_id)

Delete an assistant file.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
assistant_id = 'assistant_id_example' # String | The ID of the assistant that the file belongs to.
file_id = 'file_id_example' # String | The ID of the file to delete.

begin
  # Delete an assistant file.
  result = api_instance.delete_assistant_file(assistant_id, file_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->delete_assistant_file: #{e}"
end

Using the delete_assistant_file_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> delete_assistant_file_with_http_info(assistant_id, file_id)

begin
  # Delete an assistant file.
  data, status_code, headers = api_instance.delete_assistant_file_with_http_info(assistant_id, file_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeleteAssistantFileResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->delete_assistant_file_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
assistant_id String The ID of the assistant that the file belongs to.
file_id String The ID of the file to delete.

Return type

DeleteAssistantFileResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

delete_thread

delete_thread(thread_id)

Delete a thread.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread to delete.

begin
  # Delete a thread.
  result = api_instance.delete_thread(thread_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->delete_thread: #{e}"
end

Using the delete_thread_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> delete_thread_with_http_info(thread_id)

begin
  # Delete a thread.
  data, status_code, headers = api_instance.delete_thread_with_http_info(thread_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeleteThreadResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->delete_thread_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread to delete.

Return type

DeleteThreadResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_assistant

get_assistant(assistant_id)

Retrieves an assistant.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
assistant_id = 'assistant_id_example' # String | The ID of the assistant to retrieve.

begin
  # Retrieves an assistant.
  result = api_instance.get_assistant(assistant_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_assistant: #{e}"
end

Using the get_assistant_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_assistant_with_http_info(assistant_id)

begin
  # Retrieves an assistant.
  data, status_code, headers = api_instance.get_assistant_with_http_info(assistant_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <AssistantObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_assistant_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
assistant_id String The ID of the assistant to retrieve.

Return type

AssistantObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_assistant_file

get_assistant_file(assistant_id, file_id)

Retrieves an AssistantFile.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
assistant_id = 'assistant_id_example' # String | The ID of the assistant who the file belongs to.
file_id = 'file_id_example' # String | The ID of the file we're getting.

begin
  # Retrieves an AssistantFile.
  result = api_instance.get_assistant_file(assistant_id, file_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_assistant_file: #{e}"
end

Using the get_assistant_file_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_assistant_file_with_http_info(assistant_id, file_id)

begin
  # Retrieves an AssistantFile.
  data, status_code, headers = api_instance.get_assistant_file_with_http_info(assistant_id, file_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <AssistantFileObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_assistant_file_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
assistant_id String The ID of the assistant who the file belongs to.
file_id String The ID of the file we're getting.

Return type

AssistantFileObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_message

get_message(thread_id, message_id)

Retrieve a message.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the [thread](/docs/api-reference/threads) to which this message belongs.
message_id = 'message_id_example' # String | The ID of the message to retrieve.

begin
  # Retrieve a message.
  result = api_instance.get_message(thread_id, message_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_message: #{e}"
end

Using the get_message_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_message_with_http_info(thread_id, message_id)

begin
  # Retrieve a message.
  data, status_code, headers = api_instance.get_message_with_http_info(thread_id, message_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <MessageObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_message_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread to which this message belongs.
message_id String The ID of the message to retrieve.

Return type

MessageObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_message_file

get_message_file(thread_id, message_id, file_id)

Retrieves a message file.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_AF1WoRqd3aJAHsqc9NY7iL8F' # String | The ID of the thread to which the message and File belong.
message_id = 'msg_AF1WoRqd3aJAHsqc9NY7iL8F' # String | The ID of the message the file belongs to.
file_id = 'file-AF1WoRqd3aJAHsqc9NY7iL8F' # String | The ID of the file being retrieved.

begin
  # Retrieves a message file.
  result = api_instance.get_message_file(thread_id, message_id, file_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_message_file: #{e}"
end

Using the get_message_file_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_message_file_with_http_info(thread_id, message_id, file_id)

begin
  # Retrieves a message file.
  data, status_code, headers = api_instance.get_message_file_with_http_info(thread_id, message_id, file_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <MessageFileObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_message_file_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
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.

Return type

MessageFileObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_run

get_run(thread_id, run_id)

Retrieves a run.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the [thread](/docs/api-reference/threads) that was run.
run_id = 'run_id_example' # String | The ID of the run to retrieve.

begin
  # Retrieves a run.
  result = api_instance.get_run(thread_id, run_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_run: #{e}"
end

Using the get_run_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_run_with_http_info(thread_id, run_id)

begin
  # Retrieves a run.
  data, status_code, headers = api_instance.get_run_with_http_info(thread_id, run_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RunObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_run_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread that was run.
run_id String The ID of the run to retrieve.

Return type

RunObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_run_step

get_run_step(thread_id, run_id, step_id)

Retrieves a run step.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread to which the run and run step belongs.
run_id = 'run_id_example' # String | The ID of the run to which the run step belongs.
step_id = 'step_id_example' # String | The ID of the run step to retrieve.

begin
  # Retrieves a run step.
  result = api_instance.get_run_step(thread_id, run_id, step_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_run_step: #{e}"
end

Using the get_run_step_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_run_step_with_http_info(thread_id, run_id, step_id)

begin
  # Retrieves a run step.
  data, status_code, headers = api_instance.get_run_step_with_http_info(thread_id, run_id, step_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RunStepObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_run_step_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
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.

Return type

RunStepObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_thread

get_thread(thread_id)

Retrieves a thread.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread to retrieve.

begin
  # Retrieves a thread.
  result = api_instance.get_thread(thread_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_thread: #{e}"
end

Using the get_thread_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_thread_with_http_info(thread_id)

begin
  # Retrieves a thread.
  data, status_code, headers = api_instance.get_thread_with_http_info(thread_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ThreadObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->get_thread_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread to retrieve.

Return type

ThreadObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_assistant_files

list_assistant_files(assistant_id, opts)

Returns a list of assistant files.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
assistant_id = 'assistant_id_example' # String | The ID of the assistant the file belongs to.
opts = {
  limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. 
  order: 'asc', # String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. 
  after: 'after_example', # String | A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. 
  before: 'before_example' # String | A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. 
}

begin
  # Returns a list of assistant files.
  result = api_instance.list_assistant_files(assistant_id, opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_assistant_files: #{e}"
end

Using the list_assistant_files_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_assistant_files_with_http_info(assistant_id, opts)

begin
  # Returns a list of assistant files.
  data, status_code, headers = api_instance.list_assistant_files_with_http_info(assistant_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListAssistantFilesResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_assistant_files_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
assistant_id String The ID of the assistant the file belongs to.
limit Integer A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. [optional][default to 20]
order String Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. [optional][default to 'desc']
after String A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. [optional]
before String A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. [optional]

Return type

ListAssistantFilesResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_assistants

list_assistants(opts)

Returns a list of assistants.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
opts = {
  limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. 
  order: 'asc', # String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. 
  after: 'after_example', # String | A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. 
  before: 'before_example' # String | A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. 
}

begin
  # Returns a list of assistants.
  result = api_instance.list_assistants(opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_assistants: #{e}"
end

Using the list_assistants_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_assistants_with_http_info(opts)

begin
  # Returns a list of assistants.
  data, status_code, headers = api_instance.list_assistants_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListAssistantsResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_assistants_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
limit Integer A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. [optional][default to 20]
order String Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. [optional][default to 'desc']
after String A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. [optional]
before String A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. [optional]

Return type

ListAssistantsResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_message_files

list_message_files(thread_id, message_id, opts)

Returns a list of message files.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread that the message and files belong to.
message_id = 'message_id_example' # String | The ID of the message that the files belongs to.
opts = {
  limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. 
  order: 'asc', # String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. 
  after: 'after_example', # String | A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. 
  before: 'before_example' # String | A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. 
}

begin
  # Returns a list of message files.
  result = api_instance.list_message_files(thread_id, message_id, opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_message_files: #{e}"
end

Using the list_message_files_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_message_files_with_http_info(thread_id, message_id, opts)

begin
  # Returns a list of message files.
  data, status_code, headers = api_instance.list_message_files_with_http_info(thread_id, message_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListMessageFilesResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_message_files_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
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.
limit Integer A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. [optional][default to 20]
order String Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. [optional][default to 'desc']
after String A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. [optional]
before String A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. [optional]

Return type

ListMessageFilesResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_messages

list_messages(thread_id, opts)

Returns a list of messages for a given thread.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the [thread](/docs/api-reference/threads) the messages belong to.
opts = {
  limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. 
  order: 'asc', # String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. 
  after: 'after_example', # String | A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. 
  before: 'before_example' # String | A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. 
}

begin
  # Returns a list of messages for a given thread.
  result = api_instance.list_messages(thread_id, opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_messages: #{e}"
end

Using the list_messages_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_messages_with_http_info(thread_id, opts)

begin
  # Returns a list of messages for a given thread.
  data, status_code, headers = api_instance.list_messages_with_http_info(thread_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListMessagesResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_messages_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread the messages belong to.
limit Integer A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. [optional][default to 20]
order String Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. [optional][default to 'desc']
after String A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. [optional]
before String A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. [optional]

Return type

ListMessagesResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_run_steps

list_run_steps(thread_id, run_id, opts)

Returns a list of run steps belonging to a run.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread the run and run steps belong to.
run_id = 'run_id_example' # String | The ID of the run the run steps belong to.
opts = {
  limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. 
  order: 'asc', # String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. 
  after: 'after_example', # String | A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. 
  before: 'before_example' # String | A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. 
}

begin
  # Returns a list of run steps belonging to a run.
  result = api_instance.list_run_steps(thread_id, run_id, opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_run_steps: #{e}"
end

Using the list_run_steps_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_run_steps_with_http_info(thread_id, run_id, opts)

begin
  # Returns a list of run steps belonging to a run.
  data, status_code, headers = api_instance.list_run_steps_with_http_info(thread_id, run_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListRunStepsResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_run_steps_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
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.
limit Integer A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. [optional][default to 20]
order String Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. [optional][default to 'desc']
after String A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. [optional]
before String A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. [optional]

Return type

ListRunStepsResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_runs

list_runs(thread_id, opts)

Returns a list of runs belonging to a thread.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread the run belongs to.
opts = {
  limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. 
  order: 'asc', # String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. 
  after: 'after_example', # String | A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. 
  before: 'before_example' # String | A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. 
}

begin
  # Returns a list of runs belonging to a thread.
  result = api_instance.list_runs(thread_id, opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_runs: #{e}"
end

Using the list_runs_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_runs_with_http_info(thread_id, opts)

begin
  # Returns a list of runs belonging to a thread.
  data, status_code, headers = api_instance.list_runs_with_http_info(thread_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListRunsResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->list_runs_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread the run belongs to.
limit Integer A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. [optional][default to 20]
order String Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. [optional][default to 'desc']
after String A cursor for use in pagination. `after` 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=obj_foo in order to fetch the next page of the list. [optional]
before String A cursor for use in pagination. `before` 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=obj_foo in order to fetch the previous page of the list. [optional]

Return type

ListRunsResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

modify_message

modify_message(thread_id, message_id, modify_message_request)

Modifies a message.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread to which this message belongs.
message_id = 'message_id_example' # String | The ID of the message to modify.
modify_message_request = OpenapiClient::ModifyMessageRequest.new # ModifyMessageRequest | 

begin
  # Modifies a message.
  result = api_instance.modify_message(thread_id, message_id, modify_message_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->modify_message: #{e}"
end

Using the modify_message_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> modify_message_with_http_info(thread_id, message_id, modify_message_request)

begin
  # Modifies a message.
  data, status_code, headers = api_instance.modify_message_with_http_info(thread_id, message_id, modify_message_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <MessageObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->modify_message_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
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

Return type

MessageObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

modify_run

modify_run(thread_id, run_id, modify_run_request)

Modifies a run.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the [thread](/docs/api-reference/threads) that was run.
run_id = 'run_id_example' # String | The ID of the run to modify.
modify_run_request = OpenapiClient::ModifyRunRequest.new # ModifyRunRequest | 

begin
  # Modifies a run.
  result = api_instance.modify_run(thread_id, run_id, modify_run_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->modify_run: #{e}"
end

Using the modify_run_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> modify_run_with_http_info(thread_id, run_id, modify_run_request)

begin
  # Modifies a run.
  data, status_code, headers = api_instance.modify_run_with_http_info(thread_id, run_id, modify_run_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RunObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->modify_run_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread that was run.
run_id String The ID of the run to modify.
modify_run_request ModifyRunRequest

Return type

RunObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

modify_thread

modify_thread(thread_id, modify_thread_request)

Modifies a thread.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the thread to modify. Only the `metadata` can be modified.
modify_thread_request = OpenapiClient::ModifyThreadRequest.new # ModifyThreadRequest | 

begin
  # Modifies a thread.
  result = api_instance.modify_thread(thread_id, modify_thread_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->modify_thread: #{e}"
end

Using the modify_thread_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> modify_thread_with_http_info(thread_id, modify_thread_request)

begin
  # Modifies a thread.
  data, status_code, headers = api_instance.modify_thread_with_http_info(thread_id, modify_thread_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ThreadObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->modify_thread_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread to modify. Only the `metadata` can be modified.
modify_thread_request ModifyThreadRequest

Return type

ThreadObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

submit_tool_ouputs_to_run

submit_tool_ouputs_to_run(thread_id, run_id, submit_tool_outputs_run_request)

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.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::AssistantsApi.new
thread_id = 'thread_id_example' # String | The ID of the [thread](/docs/api-reference/threads) to which this run belongs.
run_id = 'run_id_example' # String | The ID of the run that requires the tool output submission.
submit_tool_outputs_run_request = OpenapiClient::SubmitToolOutputsRunRequest.new({tool_outputs: [OpenapiClient::SubmitToolOutputsRunRequestToolOutputsInner.new]}) # SubmitToolOutputsRunRequest | 

begin
  # 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. 
  result = api_instance.submit_tool_ouputs_to_run(thread_id, run_id, submit_tool_outputs_run_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->submit_tool_ouputs_to_run: #{e}"
end

Using the submit_tool_ouputs_to_run_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> submit_tool_ouputs_to_run_with_http_info(thread_id, run_id, submit_tool_outputs_run_request)

begin
  # 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. 
  data, status_code, headers = api_instance.submit_tool_ouputs_to_run_with_http_info(thread_id, run_id, submit_tool_outputs_run_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RunObject>
rescue OpenapiClient::ApiError => e
  puts "Error when calling AssistantsApi->submit_tool_ouputs_to_run_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
thread_id String The ID of the thread 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

Return type

RunObject

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json