openai 0.130.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/README.md +39 -3
- data/lib/openai/client.rb +0 -4
- data/lib/openai/internal/type/union.rb +5 -1
- data/lib/openai/models/batch_create_params.rb +6 -19
- data/lib/openai/models/beta/beta_compacted_response.rb +3 -3
- data/lib/openai/models/beta/beta_response.rb +0 -18
- data/lib/openai/models/beta/beta_responses_client_event.rb +0 -26
- data/lib/openai/models/beta/response_compact_params.rb +0 -18
- data/lib/openai/models/beta/response_create_params.rb +0 -18
- data/lib/openai/models/chat/completion_create_params.rb +8 -6
- data/lib/openai/models/chat_model.rb +0 -12
- data/lib/openai/models/completion_create_params.rb +4 -2
- data/lib/openai/models/graders/multi_grader.rb +11 -15
- data/lib/openai/models/image_edit_completed_event.rb +9 -17
- data/lib/openai/models/image_edit_partial_image_event.rb +9 -17
- data/lib/openai/models/image_gen_completed_event.rb +9 -17
- data/lib/openai/models/image_gen_partial_image_event.rb +9 -17
- data/lib/openai/models/images_response.rb +8 -14
- data/lib/openai/models/live/responses_delegation_config.rb +47 -21
- data/lib/openai/models/live/responses_delegation_update_config.rb +47 -21
- data/lib/openai/models/responses/compacted_response.rb +3 -3
- data/lib/openai/models/responses/response_compact_params.rb +0 -18
- data/lib/openai/models.rb +0 -32
- data/lib/openai/providers/vertex.rb +9 -6
- data/lib/openai/resources/batches.rb +2 -6
- data/lib/openai/resources/beta.rb +0 -10
- data/lib/openai/resources/chat/completions.rb +8 -6
- data/lib/openai/resources/completions.rb +4 -2
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +0 -114
- data/rbi/openai/client.rbi +0 -3
- data/rbi/openai/models/batch_create_params.rbi +6 -19
- data/rbi/openai/models/beta/beta_compacted_response.rbi +22 -20
- data/rbi/openai/models/beta/beta_response.rbi +0 -3
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +0 -12
- data/rbi/openai/models/beta/response_compact_params.rbi +0 -9
- data/rbi/openai/models/beta/response_create_params.rbi +0 -6
- data/rbi/openai/models/chat/completion_create_params.rbi +8 -6
- data/rbi/openai/models/chat_model.rbi +0 -3
- data/rbi/openai/models/completion_create_params.rbi +4 -2
- data/rbi/openai/models/graders/multi_grader.rbi +32 -27
- data/rbi/openai/models/image_edit_completed_event.rbi +11 -8
- data/rbi/openai/models/image_edit_partial_image_event.rbi +11 -8
- data/rbi/openai/models/image_gen_completed_event.rbi +11 -8
- data/rbi/openai/models/image_gen_partial_image_event.rbi +11 -8
- data/rbi/openai/models/images_response.rbi +6 -6
- data/rbi/openai/models/live/responses_delegation_config.rbi +54 -30
- data/rbi/openai/models/live/responses_delegation_update_config.rbi +54 -30
- data/rbi/openai/models/responses/compacted_response.rbi +19 -17
- data/rbi/openai/models/responses/response_compact_params.rbi +0 -12
- data/rbi/openai/models.rbi +0 -32
- data/rbi/openai/resources/batches.rbi +2 -6
- data/rbi/openai/resources/beta.rbi +0 -8
- data/rbi/openai/resources/chat/completions.rbi +8 -6
- data/rbi/openai/resources/completions.rbi +4 -2
- data/sig/openai/client.rbs +0 -2
- data/sig/openai/models/batch_create_params.rbs +4 -14
- data/sig/openai/models/beta/beta_compacted_response.rbs +4 -4
- data/sig/openai/models/beta/beta_response.rbs +0 -6
- data/sig/openai/models/beta/beta_responses_client_event.rbs +0 -6
- data/sig/openai/models/beta/response_compact_params.rbs +0 -6
- data/sig/openai/models/beta/response_create_params.rbs +0 -6
- data/sig/openai/models/chat/completion_create_params.rbs +8 -6
- data/sig/openai/models/chat_model.rbs +0 -6
- data/sig/openai/models/completion_create_params.rbs +4 -2
- data/sig/openai/models/graders/multi_grader.rbs +7 -12
- data/sig/openai/models/image_edit_completed_event.rbs +11 -9
- data/sig/openai/models/image_edit_partial_image_event.rbs +11 -9
- data/sig/openai/models/image_gen_completed_event.rbs +11 -9
- data/sig/openai/models/image_gen_partial_image_event.rbs +11 -9
- data/sig/openai/models/images_response.rbs +5 -7
- data/sig/openai/models/live/responses_delegation_config.rbs +50 -18
- data/sig/openai/models/live/responses_delegation_update_config.rbs +50 -18
- data/sig/openai/models/responses/compacted_response.rbs +4 -4
- data/sig/openai/models/responses/response_compact_params.rbs +0 -6
- data/sig/openai/models.rbs +0 -32
- data/sig/openai/resources/beta.rbs +0 -4
- metadata +1 -343
- data/lib/openai/models/beta/assistant.rb +0 -270
- data/lib/openai/models/beta/assistant_create_params.rb +0 -448
- data/lib/openai/models/beta/assistant_delete_params.rb +0 -22
- data/lib/openai/models/beta/assistant_deleted.rb +0 -30
- data/lib/openai/models/beta/assistant_list_params.rb +0 -80
- data/lib/openai/models/beta/assistant_response_format_option.rb +0 -50
- data/lib/openai/models/beta/assistant_retrieve_params.rb +0 -22
- data/lib/openai/models/beta/assistant_stream_event.rb +0 -688
- data/lib/openai/models/beta/assistant_tool.rb +0 -22
- data/lib/openai/models/beta/assistant_tool_choice.rb +0 -43
- data/lib/openai/models/beta/assistant_tool_choice_function.rb +0 -19
- data/lib/openai/models/beta/assistant_tool_choice_option.rb +0 -42
- data/lib/openai/models/beta/assistant_update_params.rb +0 -450
- data/lib/openai/models/beta/code_interpreter_tool.rb +0 -19
- data/lib/openai/models/beta/file_search_tool.rb +0 -123
- data/lib/openai/models/beta/function_tool.rb +0 -26
- data/lib/openai/models/beta/message_stream_event.rb +0 -159
- data/lib/openai/models/beta/run_step_stream_event.rb +0 -201
- data/lib/openai/models/beta/run_stream_event.rb +0 -288
- data/lib/openai/models/beta/thread.rb +0 -133
- data/lib/openai/models/beta/thread_create_and_run_params.rb +0 -857
- data/lib/openai/models/beta/thread_create_params.rb +0 -443
- data/lib/openai/models/beta/thread_delete_params.rb +0 -22
- data/lib/openai/models/beta/thread_deleted.rb +0 -30
- data/lib/openai/models/beta/thread_retrieve_params.rb +0 -22
- data/lib/openai/models/beta/thread_stream_event.rb +0 -41
- data/lib/openai/models/beta/thread_update_params.rb +0 -114
- data/lib/openai/models/beta/threads/annotation.rb +0 -27
- data/lib/openai/models/beta/threads/annotation_delta.rb +0 -27
- data/lib/openai/models/beta/threads/file_citation_annotation.rb +0 -68
- data/lib/openai/models/beta/threads/file_citation_delta_annotation.rb +0 -86
- data/lib/openai/models/beta/threads/file_path_annotation.rb +0 -67
- data/lib/openai/models/beta/threads/file_path_delta_annotation.rb +0 -76
- data/lib/openai/models/beta/threads/image_file.rb +0 -51
- data/lib/openai/models/beta/threads/image_file_content_block.rb +0 -32
- data/lib/openai/models/beta/threads/image_file_delta.rb +0 -51
- data/lib/openai/models/beta/threads/image_file_delta_block.rb +0 -41
- data/lib/openai/models/beta/threads/image_url.rb +0 -49
- data/lib/openai/models/beta/threads/image_url_content_block.rb +0 -30
- data/lib/openai/models/beta/threads/image_url_delta.rb +0 -49
- data/lib/openai/models/beta/threads/image_url_delta_block.rb +0 -39
- data/lib/openai/models/beta/threads/message.rb +0 -272
- data/lib/openai/models/beta/threads/message_content.rb +0 -33
- data/lib/openai/models/beta/threads/message_content_delta.rb +0 -33
- data/lib/openai/models/beta/threads/message_content_part_param.rb +0 -30
- data/lib/openai/models/beta/threads/message_create_params.rb +0 -172
- data/lib/openai/models/beta/threads/message_delete_params.rb +0 -30
- data/lib/openai/models/beta/threads/message_deleted.rb +0 -32
- data/lib/openai/models/beta/threads/message_delta.rb +0 -48
- data/lib/openai/models/beta/threads/message_delta_event.rb +0 -42
- data/lib/openai/models/beta/threads/message_list_params.rb +0 -98
- data/lib/openai/models/beta/threads/message_retrieve_params.rb +0 -30
- data/lib/openai/models/beta/threads/message_update_params.rb +0 -51
- data/lib/openai/models/beta/threads/refusal_content_block.rb +0 -30
- data/lib/openai/models/beta/threads/refusal_delta_block.rb +0 -39
- data/lib/openai/models/beta/threads/required_action_function_tool_call.rb +0 -73
- data/lib/openai/models/beta/threads/run.rb +0 -557
- data/lib/openai/models/beta/threads/run_cancel_params.rb +0 -30
- data/lib/openai/models/beta/threads/run_create_params.rb +0 -565
- data/lib/openai/models/beta/threads/run_list_params.rb +0 -89
- data/lib/openai/models/beta/threads/run_retrieve_params.rb +0 -30
- data/lib/openai/models/beta/threads/run_status.rb +0 -29
- data/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb +0 -69
- data/lib/openai/models/beta/threads/run_update_params.rb +0 -51
- data/lib/openai/models/beta/threads/runs/code_interpreter_logs.rb +0 -43
- data/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rb +0 -54
- data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb +0 -161
- data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb +0 -107
- data/lib/openai/models/beta/threads/runs/file_search_tool_call.rb +0 -207
- data/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rb +0 -52
- data/lib/openai/models/beta/threads/runs/function_tool_call.rb +0 -78
- data/lib/openai/models/beta/threads/runs/function_tool_call_delta.rb +0 -87
- data/lib/openai/models/beta/threads/runs/message_creation_step_details.rb +0 -48
- data/lib/openai/models/beta/threads/runs/run_step.rb +0 -311
- data/lib/openai/models/beta/threads/runs/run_step_delta.rb +0 -45
- data/lib/openai/models/beta/threads/runs/run_step_delta_event.rb +0 -46
- data/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb +0 -47
- data/lib/openai/models/beta/threads/runs/run_step_include.rb +0 -22
- data/lib/openai/models/beta/threads/runs/step_list_params.rb +0 -122
- data/lib/openai/models/beta/threads/runs/step_retrieve_params.rb +0 -65
- data/lib/openai/models/beta/threads/runs/tool_call.rb +0 -28
- data/lib/openai/models/beta/threads/runs/tool_call_delta.rb +0 -28
- data/lib/openai/models/beta/threads/runs/tool_call_delta_object.rb +0 -41
- data/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb +0 -38
- data/lib/openai/models/beta/threads/text.rb +0 -28
- data/lib/openai/models/beta/threads/text_content_block.rb +0 -30
- data/lib/openai/models/beta/threads/text_content_block_param.rb +0 -32
- data/lib/openai/models/beta/threads/text_delta.rb +0 -31
- data/lib/openai/models/beta/threads/text_delta_block.rb +0 -39
- data/lib/openai/models/image_input_reference_param.rb +0 -24
- data/lib/openai/models/video.rb +0 -161
- data/lib/openai/models/video_create_character_params.rb +0 -40
- data/lib/openai/models/video_create_character_response.rb +0 -36
- data/lib/openai/models/video_create_error.rb +0 -166
- data/lib/openai/models/video_create_params.rb +0 -85
- data/lib/openai/models/video_delete_params.rb +0 -20
- data/lib/openai/models/video_delete_response.rb +0 -38
- data/lib/openai/models/video_download_content_params.rb +0 -42
- data/lib/openai/models/video_edit_params.rb +0 -68
- data/lib/openai/models/video_extend_params.rb +0 -79
- data/lib/openai/models/video_get_character_params.rb +0 -20
- data/lib/openai/models/video_get_character_response.rb +0 -36
- data/lib/openai/models/video_list_params.rb +0 -55
- data/lib/openai/models/video_model.rb +0 -38
- data/lib/openai/models/video_remix_params.rb +0 -30
- data/lib/openai/models/video_retrieve_params.rb +0 -20
- data/lib/openai/models/video_seconds.rb +0 -16
- data/lib/openai/models/video_size.rb +0 -17
- data/lib/openai/resources/beta/assistants.rb +0 -320
- data/lib/openai/resources/beta/threads/messages.rb +0 -236
- data/lib/openai/resources/beta/threads/runs/steps.rb +0 -141
- data/lib/openai/resources/beta/threads/runs.rb +0 -623
- data/lib/openai/resources/beta/threads.rb +0 -444
- data/lib/openai/resources/videos.rb +0 -354
- data/rbi/openai/models/beta/assistant.rbi +0 -411
- data/rbi/openai/models/beta/assistant_create_params.rbi +0 -776
- data/rbi/openai/models/beta/assistant_delete_params.rbi +0 -53
- data/rbi/openai/models/beta/assistant_deleted.rbi +0 -60
- data/rbi/openai/models/beta/assistant_list_params.rbi +0 -132
- data/rbi/openai/models/beta/assistant_response_format_option.rbi +0 -49
- data/rbi/openai/models/beta/assistant_retrieve_params.rbi +0 -53
- data/rbi/openai/models/beta/assistant_stream_event.rbi +0 -1277
- data/rbi/openai/models/beta/assistant_tool.rbi +0 -28
- data/rbi/openai/models/beta/assistant_tool_choice.rbi +0 -79
- data/rbi/openai/models/beta/assistant_tool_choice_function.rbi +0 -49
- data/rbi/openai/models/beta/assistant_tool_choice_option.rbi +0 -53
- data/rbi/openai/models/beta/assistant_update_params.rbi +0 -556
- data/rbi/openai/models/beta/code_interpreter_tool.rbi +0 -49
- data/rbi/openai/models/beta/file_search_tool.rbi +0 -223
- data/rbi/openai/models/beta/function_tool.rbi +0 -59
- data/rbi/openai/models/beta/message_stream_event.rbi +0 -288
- data/rbi/openai/models/beta/run_step_stream_event.rbi +0 -378
- data/rbi/openai/models/beta/run_stream_event.rbi +0 -537
- data/rbi/openai/models/beta/thread.rbi +0 -255
- data/rbi/openai/models/beta/thread_create_and_run_params.rbi +0 -1461
- data/rbi/openai/models/beta/thread_create_params.rbi +0 -823
- data/rbi/openai/models/beta/thread_delete_params.rbi +0 -53
- data/rbi/openai/models/beta/thread_deleted.rbi +0 -60
- data/rbi/openai/models/beta/thread_retrieve_params.rbi +0 -53
- data/rbi/openai/models/beta/thread_stream_event.rbi +0 -75
- data/rbi/openai/models/beta/thread_update_params.rbi +0 -240
- data/rbi/openai/models/beta/threads/annotation.rbi +0 -34
- data/rbi/openai/models/beta/threads/annotation_delta.rbi +0 -34
- data/rbi/openai/models/beta/threads/file_citation_annotation.rbi +0 -132
- data/rbi/openai/models/beta/threads/file_citation_delta_annotation.rbi +0 -166
- data/rbi/openai/models/beta/threads/file_path_annotation.rbi +0 -131
- data/rbi/openai/models/beta/threads/file_path_delta_annotation.rbi +0 -153
- data/rbi/openai/models/beta/threads/image_file.rbi +0 -88
- data/rbi/openai/models/beta/threads/image_file_content_block.rbi +0 -66
- data/rbi/openai/models/beta/threads/image_file_delta.rbi +0 -91
- data/rbi/openai/models/beta/threads/image_file_delta_block.rbi +0 -75
- data/rbi/openai/models/beta/threads/image_url.rbi +0 -86
- data/rbi/openai/models/beta/threads/image_url_content_block.rbi +0 -64
- data/rbi/openai/models/beta/threads/image_url_delta.rbi +0 -89
- data/rbi/openai/models/beta/threads/image_url_delta_block.rbi +0 -73
- data/rbi/openai/models/beta/threads/message.rbi +0 -433
- data/rbi/openai/models/beta/threads/message_content.rbi +0 -36
- data/rbi/openai/models/beta/threads/message_content_delta.rbi +0 -36
- data/rbi/openai/models/beta/threads/message_content_part_param.rbi +0 -35
- data/rbi/openai/models/beta/threads/message_create_params.rbi +0 -299
- data/rbi/openai/models/beta/threads/message_delete_params.rbi +0 -64
- data/rbi/openai/models/beta/threads/message_deleted.rbi +0 -64
- data/rbi/openai/models/beta/threads/message_delta.rbi +0 -106
- data/rbi/openai/models/beta/threads/message_delta_event.rbi +0 -76
- data/rbi/openai/models/beta/threads/message_list_params.rbi +0 -157
- data/rbi/openai/models/beta/threads/message_retrieve_params.rbi +0 -64
- data/rbi/openai/models/beta/threads/message_update_params.rbi +0 -88
- data/rbi/openai/models/beta/threads/refusal_content_block.rbi +0 -61
- data/rbi/openai/models/beta/threads/refusal_delta_block.rbi +0 -73
- data/rbi/openai/models/beta/threads/required_action_function_tool_call.rbi +0 -130
- data/rbi/openai/models/beta/threads/run.rbi +0 -803
- data/rbi/openai/models/beta/threads/run_cancel_params.rbi +0 -64
- data/rbi/openai/models/beta/threads/run_create_params.rbi +0 -825
- data/rbi/openai/models/beta/threads/run_list_params.rbi +0 -144
- data/rbi/openai/models/beta/threads/run_retrieve_params.rbi +0 -64
- data/rbi/openai/models/beta/threads/run_status.rbi +0 -39
- data/rbi/openai/models/beta/threads/run_submit_tool_outputs_params.rbi +0 -132
- data/rbi/openai/models/beta/threads/run_update_params.rbi +0 -88
- data/rbi/openai/models/beta/threads/runs/code_interpreter_logs.rbi +0 -79
- data/rbi/openai/models/beta/threads/runs/code_interpreter_output_image.rbi +0 -118
- data/rbi/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi +0 -315
- data/rbi/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi +0 -210
- data/rbi/openai/models/beta/threads/runs/file_search_tool_call.rbi +0 -409
- data/rbi/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi +0 -89
- data/rbi/openai/models/beta/threads/runs/function_tool_call.rbi +0 -138
- data/rbi/openai/models/beta/threads/runs/function_tool_call_delta.rbi +0 -161
- data/rbi/openai/models/beta/threads/runs/message_creation_step_details.rbi +0 -111
- data/rbi/openai/models/beta/threads/runs/run_step.rbi +0 -422
- data/rbi/openai/models/beta/threads/runs/run_step_delta.rbi +0 -91
- data/rbi/openai/models/beta/threads/runs/run_step_delta_event.rbi +0 -82
- data/rbi/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi +0 -113
- data/rbi/openai/models/beta/threads/runs/run_step_include.rbi +0 -37
- data/rbi/openai/models/beta/threads/runs/step_list_params.rbi +0 -181
- data/rbi/openai/models/beta/threads/runs/step_retrieve_params.rbi +0 -105
- data/rbi/openai/models/beta/threads/runs/tool_call.rbi +0 -37
- data/rbi/openai/models/beta/threads/runs/tool_call_delta.rbi +0 -37
- data/rbi/openai/models/beta/threads/runs/tool_call_delta_object.rbi +0 -91
- data/rbi/openai/models/beta/threads/runs/tool_calls_step_details.rbi +0 -77
- data/rbi/openai/models/beta/threads/text.rbi +0 -65
- data/rbi/openai/models/beta/threads/text_content_block.rbi +0 -64
- data/rbi/openai/models/beta/threads/text_content_block_param.rbi +0 -63
- data/rbi/openai/models/beta/threads/text_delta.rbi +0 -81
- data/rbi/openai/models/beta/threads/text_delta_block.rbi +0 -73
- data/rbi/openai/models/image_input_reference_param.rbi +0 -58
- data/rbi/openai/models/video.rbi +0 -203
- data/rbi/openai/models/video_create_character_params.rbi +0 -68
- data/rbi/openai/models/video_create_character_response.rbi +0 -63
- data/rbi/openai/models/video_create_error.rbi +0 -255
- data/rbi/openai/models/video_create_params.rbi +0 -132
- data/rbi/openai/models/video_delete_params.rbi +0 -49
- data/rbi/openai/models/video_delete_response.rbi +0 -64
- data/rbi/openai/models/video_download_content_params.rbi +0 -81
- data/rbi/openai/models/video_edit_params.rbi +0 -122
- data/rbi/openai/models/video_extend_params.rbi +0 -134
- data/rbi/openai/models/video_get_character_params.rbi +0 -49
- data/rbi/openai/models/video_get_character_response.rbi +0 -63
- data/rbi/openai/models/video_list_params.rbi +0 -101
- data/rbi/openai/models/video_model.rbi +0 -35
- data/rbi/openai/models/video_remix_params.rbi +0 -58
- data/rbi/openai/models/video_retrieve_params.rbi +0 -49
- data/rbi/openai/models/video_seconds.rbi +0 -22
- data/rbi/openai/models/video_size.rbi +0 -23
- data/rbi/openai/resources/beta/assistants.rbi +0 -285
- data/rbi/openai/resources/beta/threads/messages.rbi +0 -161
- data/rbi/openai/resources/beta/threads/runs/steps.rbi +0 -107
- data/rbi/openai/resources/beta/threads/runs.rbi +0 -527
- data/rbi/openai/resources/beta/threads.rbi +0 -391
- data/rbi/openai/resources/videos.rbi +0 -205
- data/sig/openai/models/beta/assistant.rbs +0 -278
- data/sig/openai/models/beta/assistant_create_params.rbs +0 -485
- data/sig/openai/models/beta/assistant_delete_params.rbs +0 -25
- data/sig/openai/models/beta/assistant_deleted.rbs +0 -28
- data/sig/openai/models/beta/assistant_list_params.rbs +0 -104
- data/sig/openai/models/beta/assistant_response_format_option.rbs +0 -17
- data/sig/openai/models/beta/assistant_retrieve_params.rbs +0 -25
- data/sig/openai/models/beta/assistant_stream_event.rbs +0 -645
- data/sig/openai/models/beta/assistant_tool.rbs +0 -16
- data/sig/openai/models/beta/assistant_tool_choice.rbs +0 -46
- data/sig/openai/models/beta/assistant_tool_choice_function.rbs +0 -18
- data/sig/openai/models/beta/assistant_tool_choice_option.rbs +0 -27
- data/sig/openai/models/beta/assistant_update_params.rbs +0 -396
- data/sig/openai/models/beta/code_interpreter_tool.rbs +0 -18
- data/sig/openai/models/beta/file_search_tool.rbs +0 -159
- data/sig/openai/models/beta/function_tool.rbs +0 -27
- data/sig/openai/models/beta/message_stream_event.rbs +0 -153
- data/sig/openai/models/beta/run_step_stream_event.rbs +0 -197
- data/sig/openai/models/beta/run_stream_event.rbs +0 -269
- data/sig/openai/models/beta/thread.rbs +0 -150
- data/sig/openai/models/beta/thread_create_and_run_params.rbs +0 -885
- data/sig/openai/models/beta/thread_create_params.rbs +0 -492
- data/sig/openai/models/beta/thread_delete_params.rbs +0 -25
- data/sig/openai/models/beta/thread_deleted.rbs +0 -28
- data/sig/openai/models/beta/thread_retrieve_params.rbs +0 -25
- data/sig/openai/models/beta/thread_stream_event.rbs +0 -43
- data/sig/openai/models/beta/thread_update_params.rbs +0 -137
- data/sig/openai/models/beta/threads/annotation.rbs +0 -17
- data/sig/openai/models/beta/threads/annotation_delta.rbs +0 -17
- data/sig/openai/models/beta/threads/file_citation_annotation.rbs +0 -63
- data/sig/openai/models/beta/threads/file_citation_delta_annotation.rbs +0 -93
- data/sig/openai/models/beta/threads/file_path_annotation.rbs +0 -63
- data/sig/openai/models/beta/threads/file_path_delta_annotation.rbs +0 -85
- data/sig/openai/models/beta/threads/image_file.rbs +0 -59
- data/sig/openai/models/beta/threads/image_file_content_block.rbs +0 -29
- data/sig/openai/models/beta/threads/image_file_delta.rbs +0 -64
- data/sig/openai/models/beta/threads/image_file_delta_block.rbs +0 -44
- data/sig/openai/models/beta/threads/image_url.rbs +0 -57
- data/sig/openai/models/beta/threads/image_url_content_block.rbs +0 -29
- data/sig/openai/models/beta/threads/image_url_delta.rbs +0 -61
- data/sig/openai/models/beta/threads/image_url_delta_block.rbs +0 -44
- data/sig/openai/models/beta/threads/message.rbs +0 -275
- data/sig/openai/models/beta/threads/message_content.rbs +0 -19
- data/sig/openai/models/beta/threads/message_content_delta.rbs +0 -19
- data/sig/openai/models/beta/threads/message_content_part_param.rbs +0 -18
- data/sig/openai/models/beta/threads/message_create_params.rbs +0 -167
- data/sig/openai/models/beta/threads/message_delete_params.rbs +0 -35
- data/sig/openai/models/beta/threads/message_deleted.rbs +0 -30
- data/sig/openai/models/beta/threads/message_delta.rbs +0 -56
- data/sig/openai/models/beta/threads/message_delta_event.rbs +0 -43
- data/sig/openai/models/beta/threads/message_list_params.rbs +0 -122
- data/sig/openai/models/beta/threads/message_retrieve_params.rbs +0 -35
- data/sig/openai/models/beta/threads/message_update_params.rbs +0 -53
- data/sig/openai/models/beta/threads/refusal_content_block.rbs +0 -22
- data/sig/openai/models/beta/threads/refusal_delta_block.rbs +0 -34
- data/sig/openai/models/beta/threads/required_action_function_tool_call.rbs +0 -69
- data/sig/openai/models/beta/threads/run.rbs +0 -545
- data/sig/openai/models/beta/threads/run_cancel_params.rbs +0 -35
- data/sig/openai/models/beta/threads/run_create_params.rbs +0 -524
- data/sig/openai/models/beta/threads/run_list_params.rbs +0 -111
- data/sig/openai/models/beta/threads/run_retrieve_params.rbs +0 -35
- data/sig/openai/models/beta/threads/run_status.rbs +0 -34
- data/sig/openai/models/beta/threads/run_submit_tool_outputs_params.rbs +0 -70
- data/sig/openai/models/beta/threads/run_update_params.rbs +0 -53
- data/sig/openai/models/beta/threads/runs/code_interpreter_logs.rbs +0 -40
- data/sig/openai/models/beta/threads/runs/code_interpreter_output_image.rbs +0 -65
- data/sig/openai/models/beta/threads/runs/code_interpreter_tool_call.rbs +0 -147
- data/sig/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbs +0 -115
- data/sig/openai/models/beta/threads/runs/file_search_tool_call.rbs +0 -228
- data/sig/openai/models/beta/threads/runs/file_search_tool_call_delta.rbs +0 -58
- data/sig/openai/models/beta/threads/runs/function_tool_call.rbs +0 -80
- data/sig/openai/models/beta/threads/runs/function_tool_call_delta.rbs +0 -103
- data/sig/openai/models/beta/threads/runs/message_creation_step_details.rbs +0 -47
- data/sig/openai/models/beta/threads/runs/run_step.rbs +0 -290
- data/sig/openai/models/beta/threads/runs/run_step_delta.rbs +0 -46
- data/sig/openai/models/beta/threads/runs/run_step_delta_event.rbs +0 -47
- data/sig/openai/models/beta/threads/runs/run_step_delta_message_delta.rbs +0 -56
- data/sig/openai/models/beta/threads/runs/run_step_include.rbs +0 -22
- data/sig/openai/models/beta/threads/runs/step_list_params.rbs +0 -149
- data/sig/openai/models/beta/threads/runs/step_retrieve_params.rbs +0 -73
- data/sig/openai/models/beta/threads/runs/tool_call.rbs +0 -20
- data/sig/openai/models/beta/threads/runs/tool_call_delta.rbs +0 -20
- data/sig/openai/models/beta/threads/runs/tool_call_delta_object.rbs +0 -48
- data/sig/openai/models/beta/threads/runs/tool_calls_step_details.rbs +0 -41
- data/sig/openai/models/beta/threads/text.rbs +0 -32
- data/sig/openai/models/beta/threads/text_content_block.rbs +0 -26
- data/sig/openai/models/beta/threads/text_content_block_param.rbs +0 -25
- data/sig/openai/models/beta/threads/text_delta.rbs +0 -39
- data/sig/openai/models/beta/threads/text_delta_block.rbs +0 -44
- data/sig/openai/models/image_input_reference_param.rbs +0 -23
- data/sig/openai/models/video.rbs +0 -142
- data/sig/openai/models/video_create_character_params.rbs +0 -45
- data/sig/openai/models/video_create_character_response.rbs +0 -27
- data/sig/openai/models/video_create_error.rbs +0 -163
- data/sig/openai/models/video_create_params.rbs +0 -104
- data/sig/openai/models/video_delete_params.rbs +0 -23
- data/sig/openai/models/video_delete_response.rbs +0 -31
- data/sig/openai/models/video_download_content_params.rbs +0 -51
- data/sig/openai/models/video_edit_params.rbs +0 -77
- data/sig/openai/models/video_extend_params.rbs +0 -87
- data/sig/openai/models/video_get_character_params.rbs +0 -23
- data/sig/openai/models/video_get_character_response.rbs +0 -27
- data/sig/openai/models/video_list_params.rbs +0 -70
- data/sig/openai/models/video_model.rbs +0 -23
- data/sig/openai/models/video_remix_params.rbs +0 -34
- data/sig/openai/models/video_retrieve_params.rbs +0 -23
- data/sig/openai/models/video_seconds.rbs +0 -15
- data/sig/openai/models/video_size.rbs +0 -16
- data/sig/openai/resources/beta/assistants.rbs +0 -58
- data/sig/openai/resources/beta/threads/messages.rbs +0 -49
- data/sig/openai/resources/beta/threads/runs/steps.rbs +0 -32
- data/sig/openai/resources/beta/threads/runs.rbs +0 -99
- data/sig/openai/resources/beta/threads.rbs +0 -75
- data/sig/openai/resources/videos.rbs +0 -69
|
@@ -1,527 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module OpenAI
|
|
4
|
-
module Resources
|
|
5
|
-
|
|
6
|
-
class Beta
|
|
7
|
-
|
|
8
|
-
class Threads
|
|
9
|
-
|
|
10
|
-
# Build Assistants that can call models and use tools.
|
|
11
|
-
class Runs
|
|
12
|
-
|
|
13
|
-
# Build Assistants that can call models and use tools.
|
|
14
|
-
sig { returns(OpenAI::Resources::Beta::Threads::Runs::Steps) }
|
|
15
|
-
attr_reader :steps
|
|
16
|
-
|
|
17
|
-
# See {OpenAI::Resources::Beta::Threads::Runs#create_stream_raw} for streaming
|
|
18
|
-
# counterpart.
|
|
19
|
-
#
|
|
20
|
-
# Create a run.
|
|
21
|
-
sig {
|
|
22
|
-
params(
|
|
23
|
-
thread_id: String,
|
|
24
|
-
assistant_id: String,
|
|
25
|
-
include: T::Array[OpenAI::Beta::Threads::Runs::RunStepInclude::OrSymbol],
|
|
26
|
-
additional_instructions: T.nilable(String),
|
|
27
|
-
additional_messages: T.nilable(
|
|
28
|
-
T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::OrHash]
|
|
29
|
-
),
|
|
30
|
-
instructions: T.nilable(String),
|
|
31
|
-
max_completion_tokens: T.nilable(Integer),
|
|
32
|
-
max_prompt_tokens: T.nilable(Integer),
|
|
33
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
34
|
-
model: T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol)),
|
|
35
|
-
parallel_tool_calls: T::Boolean,
|
|
36
|
-
reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
37
|
-
response_format: T.nilable(
|
|
38
|
-
T.any(
|
|
39
|
-
Symbol,
|
|
40
|
-
OpenAI::ResponseFormatText::OrHash,
|
|
41
|
-
OpenAI::ResponseFormatJSONObject::OrHash,
|
|
42
|
-
OpenAI::ResponseFormatJSONSchema::OrHash
|
|
43
|
-
)
|
|
44
|
-
),
|
|
45
|
-
temperature: T.nilable(Float),
|
|
46
|
-
tool_choice: T.nilable(
|
|
47
|
-
T.any(
|
|
48
|
-
OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol,
|
|
49
|
-
OpenAI::Beta::AssistantToolChoice::OrHash
|
|
50
|
-
)
|
|
51
|
-
),
|
|
52
|
-
tools: T.nilable(
|
|
53
|
-
T::Array[
|
|
54
|
-
T.any(
|
|
55
|
-
OpenAI::Beta::CodeInterpreterTool::OrHash,
|
|
56
|
-
OpenAI::Beta::FileSearchTool::OrHash,
|
|
57
|
-
OpenAI::Beta::FunctionTool::OrHash
|
|
58
|
-
)
|
|
59
|
-
]
|
|
60
|
-
),
|
|
61
|
-
top_p: T.nilable(Float),
|
|
62
|
-
truncation_strategy: T.nilable(OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::OrHash),
|
|
63
|
-
stream: T.noreturn,
|
|
64
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
65
|
-
)
|
|
66
|
-
.returns(OpenAI::Beta::Threads::Run)
|
|
67
|
-
}
|
|
68
|
-
def create(
|
|
69
|
-
# Path param: The ID of the thread to run.
|
|
70
|
-
thread_id,
|
|
71
|
-
# Body param: The ID of the
|
|
72
|
-
# [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
|
|
73
|
-
# to execute this run.
|
|
74
|
-
assistant_id:,
|
|
75
|
-
# Query param: A list of additional fields to include in the response. Currently
|
|
76
|
-
# the only supported value is
|
|
77
|
-
# `step_details.tool_calls[*].file_search.results[*].content` to fetch the file
|
|
78
|
-
# search result content.
|
|
79
|
-
#
|
|
80
|
-
# See the
|
|
81
|
-
# [file search tool documentation](https://developers.openai.com/api/docs/guides/tools-file-search#retrieval-customization)
|
|
82
|
-
# for more information.
|
|
83
|
-
include: nil,
|
|
84
|
-
# Body param: Appends additional instructions at the end of the instructions for
|
|
85
|
-
# the run. This is useful for modifying the behavior on a per-run basis without
|
|
86
|
-
# overriding other instructions.
|
|
87
|
-
additional_instructions: nil,
|
|
88
|
-
# Body param: Adds additional messages to the thread before creating the run.
|
|
89
|
-
additional_messages: nil,
|
|
90
|
-
# Body param: Overrides the
|
|
91
|
-
# [instructions](https://developers.openai.com/api/docs/assistants/migration) of
|
|
92
|
-
# the assistant. This is useful for modifying the behavior on a per-run basis.
|
|
93
|
-
instructions: nil,
|
|
94
|
-
# Body param: The maximum number of completion tokens that may be used over the
|
|
95
|
-
# course of the run. The run will make a best effort to use only the number of
|
|
96
|
-
# completion tokens specified, across multiple turns of the run. If the run
|
|
97
|
-
# exceeds the number of completion tokens specified, the run will end with status
|
|
98
|
-
# `incomplete`. See `incomplete_details` for more info.
|
|
99
|
-
max_completion_tokens: nil,
|
|
100
|
-
# Body param: The maximum number of prompt tokens that may be used over the course
|
|
101
|
-
# of the run. The run will make a best effort to use only the number of prompt
|
|
102
|
-
# tokens specified, across multiple turns of the run. If the run exceeds the
|
|
103
|
-
# number of prompt tokens specified, the run will end with status `incomplete`.
|
|
104
|
-
# See `incomplete_details` for more info.
|
|
105
|
-
max_prompt_tokens: nil,
|
|
106
|
-
# Body param: Set of 16 key-value pairs that can be attached to an object. This
|
|
107
|
-
# can be useful for storing additional information about the object in a
|
|
108
|
-
# structured format, and querying for objects via API or the dashboard.
|
|
109
|
-
#
|
|
110
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
111
|
-
# a maximum length of 512 characters.
|
|
112
|
-
metadata: nil,
|
|
113
|
-
# Body param: The ID of the
|
|
114
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
115
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
116
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
117
|
-
# will be used.
|
|
118
|
-
model: nil,
|
|
119
|
-
# Body param: Whether to enable
|
|
120
|
-
# [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
|
|
121
|
-
# during tool use.
|
|
122
|
-
parallel_tool_calls: nil,
|
|
123
|
-
# Body param: Constrains effort on reasoning for reasoning models. Currently
|
|
124
|
-
# supported values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and
|
|
125
|
-
# `max`. Reducing reasoning effort can result in faster responses and fewer tokens
|
|
126
|
-
# used on reasoning in a response. Not all reasoning models support every value.
|
|
127
|
-
# See the
|
|
128
|
-
# [reasoning guide](https://developers.openai.com/api/docs/guides/reasoning) for
|
|
129
|
-
# model-specific support.
|
|
130
|
-
reasoning_effort: nil,
|
|
131
|
-
# Body param: Specifies the format that the model must output. Compatible with
|
|
132
|
-
# [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
|
|
133
|
-
# [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
|
|
134
|
-
# all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
135
|
-
#
|
|
136
|
-
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
137
|
-
# Outputs which ensures the model will match your supplied JSON schema. Learn more
|
|
138
|
-
# in the
|
|
139
|
-
# [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
140
|
-
#
|
|
141
|
-
# Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
|
142
|
-
# message the model generates is valid JSON.
|
|
143
|
-
#
|
|
144
|
-
# **Important:** when using JSON mode, you **must** also instruct the model to
|
|
145
|
-
# produce JSON yourself via a system or user message. Without this, the model may
|
|
146
|
-
# generate an unending stream of whitespace until the generation reaches the token
|
|
147
|
-
# limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
148
|
-
# the message content may be partially cut off if `finish_reason="length"`, which
|
|
149
|
-
# indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
150
|
-
# max context length.
|
|
151
|
-
response_format: nil,
|
|
152
|
-
# Body param: What sampling temperature to use, between 0 and 2. Higher values
|
|
153
|
-
# like 0.8 will make the output more random, while lower values like 0.2 will make
|
|
154
|
-
# it more focused and deterministic.
|
|
155
|
-
temperature: nil,
|
|
156
|
-
# Body param: Controls which (if any) tool is called by the model. `none` means
|
|
157
|
-
# the model will not call any tools and instead generates a message. `auto` is the
|
|
158
|
-
# default value and means the model can pick between generating a message or
|
|
159
|
-
# calling one or more tools. `required` means the model must call one or more
|
|
160
|
-
# tools before responding to the user. Specifying a particular tool like
|
|
161
|
-
# `{"type": "file_search"}` or
|
|
162
|
-
# `{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
|
163
|
-
# call that tool.
|
|
164
|
-
tool_choice: nil,
|
|
165
|
-
# Body param: Override the tools the assistant can use for this run. This is
|
|
166
|
-
# useful for modifying the behavior on a per-run basis.
|
|
167
|
-
tools: nil,
|
|
168
|
-
# Body param: An alternative to sampling with temperature, called nucleus
|
|
169
|
-
# sampling, where the model considers the results of the tokens with top_p
|
|
170
|
-
# probability mass. So 0.1 means only the tokens comprising the top 10%
|
|
171
|
-
# probability mass are considered.
|
|
172
|
-
#
|
|
173
|
-
# We generally recommend altering this or temperature but not both.
|
|
174
|
-
top_p: nil,
|
|
175
|
-
# Body param: Controls for how a thread will be truncated prior to the run. Use
|
|
176
|
-
# this to control the initial context window of the run.
|
|
177
|
-
truncation_strategy: nil,
|
|
178
|
-
# There is no need to provide `stream:`. Instead, use `#create_stream_raw` or
|
|
179
|
-
# `#create` for streaming and non-streaming use cases, respectively.
|
|
180
|
-
stream: false,
|
|
181
|
-
request_options: {}
|
|
182
|
-
)
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
# See {OpenAI::Resources::Beta::Threads::Runs#create} for non-streaming
|
|
186
|
-
# counterpart.
|
|
187
|
-
#
|
|
188
|
-
# Create a run.
|
|
189
|
-
sig {
|
|
190
|
-
params(
|
|
191
|
-
thread_id: String,
|
|
192
|
-
assistant_id: String,
|
|
193
|
-
include: T::Array[OpenAI::Beta::Threads::Runs::RunStepInclude::OrSymbol],
|
|
194
|
-
additional_instructions: T.nilable(String),
|
|
195
|
-
additional_messages: T.nilable(
|
|
196
|
-
T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::OrHash]
|
|
197
|
-
),
|
|
198
|
-
instructions: T.nilable(String),
|
|
199
|
-
max_completion_tokens: T.nilable(Integer),
|
|
200
|
-
max_prompt_tokens: T.nilable(Integer),
|
|
201
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
202
|
-
model: T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol)),
|
|
203
|
-
parallel_tool_calls: T::Boolean,
|
|
204
|
-
reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
205
|
-
response_format: T.nilable(
|
|
206
|
-
T.any(
|
|
207
|
-
Symbol,
|
|
208
|
-
OpenAI::ResponseFormatText::OrHash,
|
|
209
|
-
OpenAI::ResponseFormatJSONObject::OrHash,
|
|
210
|
-
OpenAI::ResponseFormatJSONSchema::OrHash
|
|
211
|
-
)
|
|
212
|
-
),
|
|
213
|
-
temperature: T.nilable(Float),
|
|
214
|
-
tool_choice: T.nilable(
|
|
215
|
-
T.any(
|
|
216
|
-
OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol,
|
|
217
|
-
OpenAI::Beta::AssistantToolChoice::OrHash
|
|
218
|
-
)
|
|
219
|
-
),
|
|
220
|
-
tools: T.nilable(
|
|
221
|
-
T::Array[
|
|
222
|
-
T.any(
|
|
223
|
-
OpenAI::Beta::CodeInterpreterTool::OrHash,
|
|
224
|
-
OpenAI::Beta::FileSearchTool::OrHash,
|
|
225
|
-
OpenAI::Beta::FunctionTool::OrHash
|
|
226
|
-
)
|
|
227
|
-
]
|
|
228
|
-
),
|
|
229
|
-
top_p: T.nilable(Float),
|
|
230
|
-
truncation_strategy: T.nilable(OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::OrHash),
|
|
231
|
-
stream: T.noreturn,
|
|
232
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
233
|
-
)
|
|
234
|
-
.returns(OpenAI::Internal::Stream[OpenAI::Beta::AssistantStreamEvent::Variants])
|
|
235
|
-
}
|
|
236
|
-
def create_stream_raw(
|
|
237
|
-
# Path param: The ID of the thread to run.
|
|
238
|
-
thread_id,
|
|
239
|
-
# Body param: The ID of the
|
|
240
|
-
# [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
|
|
241
|
-
# to execute this run.
|
|
242
|
-
assistant_id:,
|
|
243
|
-
# Query param: A list of additional fields to include in the response. Currently
|
|
244
|
-
# the only supported value is
|
|
245
|
-
# `step_details.tool_calls[*].file_search.results[*].content` to fetch the file
|
|
246
|
-
# search result content.
|
|
247
|
-
#
|
|
248
|
-
# See the
|
|
249
|
-
# [file search tool documentation](https://developers.openai.com/api/docs/guides/tools-file-search#retrieval-customization)
|
|
250
|
-
# for more information.
|
|
251
|
-
include: nil,
|
|
252
|
-
# Body param: Appends additional instructions at the end of the instructions for
|
|
253
|
-
# the run. This is useful for modifying the behavior on a per-run basis without
|
|
254
|
-
# overriding other instructions.
|
|
255
|
-
additional_instructions: nil,
|
|
256
|
-
# Body param: Adds additional messages to the thread before creating the run.
|
|
257
|
-
additional_messages: nil,
|
|
258
|
-
# Body param: Overrides the
|
|
259
|
-
# [instructions](https://developers.openai.com/api/docs/assistants/migration) of
|
|
260
|
-
# the assistant. This is useful for modifying the behavior on a per-run basis.
|
|
261
|
-
instructions: nil,
|
|
262
|
-
# Body param: The maximum number of completion tokens that may be used over the
|
|
263
|
-
# course of the run. The run will make a best effort to use only the number of
|
|
264
|
-
# completion tokens specified, across multiple turns of the run. If the run
|
|
265
|
-
# exceeds the number of completion tokens specified, the run will end with status
|
|
266
|
-
# `incomplete`. See `incomplete_details` for more info.
|
|
267
|
-
max_completion_tokens: nil,
|
|
268
|
-
# Body param: The maximum number of prompt tokens that may be used over the course
|
|
269
|
-
# of the run. The run will make a best effort to use only the number of prompt
|
|
270
|
-
# tokens specified, across multiple turns of the run. If the run exceeds the
|
|
271
|
-
# number of prompt tokens specified, the run will end with status `incomplete`.
|
|
272
|
-
# See `incomplete_details` for more info.
|
|
273
|
-
max_prompt_tokens: nil,
|
|
274
|
-
# Body param: Set of 16 key-value pairs that can be attached to an object. This
|
|
275
|
-
# can be useful for storing additional information about the object in a
|
|
276
|
-
# structured format, and querying for objects via API or the dashboard.
|
|
277
|
-
#
|
|
278
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
279
|
-
# a maximum length of 512 characters.
|
|
280
|
-
metadata: nil,
|
|
281
|
-
# Body param: The ID of the
|
|
282
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
283
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
284
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
285
|
-
# will be used.
|
|
286
|
-
model: nil,
|
|
287
|
-
# Body param: Whether to enable
|
|
288
|
-
# [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
|
|
289
|
-
# during tool use.
|
|
290
|
-
parallel_tool_calls: nil,
|
|
291
|
-
# Body param: Constrains effort on reasoning for reasoning models. Currently
|
|
292
|
-
# supported values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and
|
|
293
|
-
# `max`. Reducing reasoning effort can result in faster responses and fewer tokens
|
|
294
|
-
# used on reasoning in a response. Not all reasoning models support every value.
|
|
295
|
-
# See the
|
|
296
|
-
# [reasoning guide](https://developers.openai.com/api/docs/guides/reasoning) for
|
|
297
|
-
# model-specific support.
|
|
298
|
-
reasoning_effort: nil,
|
|
299
|
-
# Body param: Specifies the format that the model must output. Compatible with
|
|
300
|
-
# [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
|
|
301
|
-
# [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
|
|
302
|
-
# all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
303
|
-
#
|
|
304
|
-
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
305
|
-
# Outputs which ensures the model will match your supplied JSON schema. Learn more
|
|
306
|
-
# in the
|
|
307
|
-
# [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
308
|
-
#
|
|
309
|
-
# Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
|
310
|
-
# message the model generates is valid JSON.
|
|
311
|
-
#
|
|
312
|
-
# **Important:** when using JSON mode, you **must** also instruct the model to
|
|
313
|
-
# produce JSON yourself via a system or user message. Without this, the model may
|
|
314
|
-
# generate an unending stream of whitespace until the generation reaches the token
|
|
315
|
-
# limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
316
|
-
# the message content may be partially cut off if `finish_reason="length"`, which
|
|
317
|
-
# indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
318
|
-
# max context length.
|
|
319
|
-
response_format: nil,
|
|
320
|
-
# Body param: What sampling temperature to use, between 0 and 2. Higher values
|
|
321
|
-
# like 0.8 will make the output more random, while lower values like 0.2 will make
|
|
322
|
-
# it more focused and deterministic.
|
|
323
|
-
temperature: nil,
|
|
324
|
-
# Body param: Controls which (if any) tool is called by the model. `none` means
|
|
325
|
-
# the model will not call any tools and instead generates a message. `auto` is the
|
|
326
|
-
# default value and means the model can pick between generating a message or
|
|
327
|
-
# calling one or more tools. `required` means the model must call one or more
|
|
328
|
-
# tools before responding to the user. Specifying a particular tool like
|
|
329
|
-
# `{"type": "file_search"}` or
|
|
330
|
-
# `{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
|
331
|
-
# call that tool.
|
|
332
|
-
tool_choice: nil,
|
|
333
|
-
# Body param: Override the tools the assistant can use for this run. This is
|
|
334
|
-
# useful for modifying the behavior on a per-run basis.
|
|
335
|
-
tools: nil,
|
|
336
|
-
# Body param: An alternative to sampling with temperature, called nucleus
|
|
337
|
-
# sampling, where the model considers the results of the tokens with top_p
|
|
338
|
-
# probability mass. So 0.1 means only the tokens comprising the top 10%
|
|
339
|
-
# probability mass are considered.
|
|
340
|
-
#
|
|
341
|
-
# We generally recommend altering this or temperature but not both.
|
|
342
|
-
top_p: nil,
|
|
343
|
-
# Body param: Controls for how a thread will be truncated prior to the run. Use
|
|
344
|
-
# this to control the initial context window of the run.
|
|
345
|
-
truncation_strategy: nil,
|
|
346
|
-
# There is no need to provide `stream:`. Instead, use `#create_stream_raw` or
|
|
347
|
-
# `#create` for streaming and non-streaming use cases, respectively.
|
|
348
|
-
stream: true,
|
|
349
|
-
request_options: {}
|
|
350
|
-
)
|
|
351
|
-
end
|
|
352
|
-
|
|
353
|
-
# Retrieves a run.
|
|
354
|
-
sig {
|
|
355
|
-
params(run_id: String, thread_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
356
|
-
OpenAI::Beta::Threads::Run
|
|
357
|
-
)
|
|
358
|
-
}
|
|
359
|
-
def retrieve(
|
|
360
|
-
# The ID of the run to retrieve.
|
|
361
|
-
run_id,
|
|
362
|
-
# The ID of the
|
|
363
|
-
# [thread](https://developers.openai.com/api/docs/assistants/migration) that was
|
|
364
|
-
# run.
|
|
365
|
-
thread_id:,
|
|
366
|
-
request_options: {}
|
|
367
|
-
)
|
|
368
|
-
end
|
|
369
|
-
|
|
370
|
-
# Modifies a run.
|
|
371
|
-
sig {
|
|
372
|
-
params(
|
|
373
|
-
run_id: String,
|
|
374
|
-
thread_id: String,
|
|
375
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
376
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
377
|
-
)
|
|
378
|
-
.returns(OpenAI::Beta::Threads::Run)
|
|
379
|
-
}
|
|
380
|
-
def update(
|
|
381
|
-
# Path param: The ID of the run to modify.
|
|
382
|
-
run_id,
|
|
383
|
-
# Path param: The ID of the
|
|
384
|
-
# [thread](https://developers.openai.com/api/docs/assistants/migration) that was
|
|
385
|
-
# run.
|
|
386
|
-
thread_id:,
|
|
387
|
-
# Body param: Set of 16 key-value pairs that can be attached to an object. This
|
|
388
|
-
# can be useful for storing additional information about the object in a
|
|
389
|
-
# structured format, and querying for objects via API or the dashboard.
|
|
390
|
-
#
|
|
391
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
392
|
-
# a maximum length of 512 characters.
|
|
393
|
-
metadata: nil,
|
|
394
|
-
request_options: {}
|
|
395
|
-
)
|
|
396
|
-
end
|
|
397
|
-
|
|
398
|
-
# Returns a list of runs belonging to a thread.
|
|
399
|
-
sig {
|
|
400
|
-
params(
|
|
401
|
-
thread_id: String,
|
|
402
|
-
after: String,
|
|
403
|
-
before: String,
|
|
404
|
-
limit: Integer,
|
|
405
|
-
order: OpenAI::Beta::Threads::RunListParams::Order::OrSymbol,
|
|
406
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
407
|
-
)
|
|
408
|
-
.returns(OpenAI::Internal::CursorPage[OpenAI::Beta::Threads::Run])
|
|
409
|
-
}
|
|
410
|
-
def list(
|
|
411
|
-
# The ID of the thread the run belongs to.
|
|
412
|
-
thread_id,
|
|
413
|
-
# A cursor for use in pagination. `after` is an object ID that defines your place
|
|
414
|
-
# in the list. For instance, if you make a list request and receive 100 objects,
|
|
415
|
-
# ending with obj_foo, your subsequent call can include after=obj_foo in order to
|
|
416
|
-
# fetch the next page of the list.
|
|
417
|
-
after: nil,
|
|
418
|
-
# A cursor for use in pagination. `before` is an object ID that defines your place
|
|
419
|
-
# in the list. For instance, if you make a list request and receive 100 objects,
|
|
420
|
-
# starting with obj_foo, your subsequent call can include before=obj_foo in order
|
|
421
|
-
# to fetch the previous page of the list.
|
|
422
|
-
before: nil,
|
|
423
|
-
# A limit on the number of objects to be returned. Limit can range between 1 and
|
|
424
|
-
# 100, and the default is 20.
|
|
425
|
-
limit: nil,
|
|
426
|
-
# Sort order by the `created_at` timestamp of the objects. `asc` for ascending
|
|
427
|
-
# order and `desc` for descending order.
|
|
428
|
-
order: nil,
|
|
429
|
-
request_options: {}
|
|
430
|
-
)
|
|
431
|
-
end
|
|
432
|
-
|
|
433
|
-
# Cancels a run that is `in_progress`.
|
|
434
|
-
sig {
|
|
435
|
-
params(run_id: String, thread_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
436
|
-
OpenAI::Beta::Threads::Run
|
|
437
|
-
)
|
|
438
|
-
}
|
|
439
|
-
def cancel(
|
|
440
|
-
# The ID of the run to cancel.
|
|
441
|
-
run_id,
|
|
442
|
-
# The ID of the thread to which this run belongs.
|
|
443
|
-
thread_id:,
|
|
444
|
-
request_options: {}
|
|
445
|
-
)
|
|
446
|
-
end
|
|
447
|
-
|
|
448
|
-
# See {OpenAI::Resources::Beta::Threads::Runs#submit_tool_outputs_stream_raw} for
|
|
449
|
-
# streaming counterpart.
|
|
450
|
-
#
|
|
451
|
-
# When a run has the `status: "requires_action"` and `required_action.type` is
|
|
452
|
-
# `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
|
|
453
|
-
# tool calls once they're all completed. All outputs must be submitted in a single
|
|
454
|
-
# request.
|
|
455
|
-
sig {
|
|
456
|
-
params(
|
|
457
|
-
run_id: String,
|
|
458
|
-
thread_id: String,
|
|
459
|
-
tool_outputs: T::Array[OpenAI::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput::OrHash],
|
|
460
|
-
stream: T.noreturn,
|
|
461
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
462
|
-
)
|
|
463
|
-
.returns(OpenAI::Beta::Threads::Run)
|
|
464
|
-
}
|
|
465
|
-
def submit_tool_outputs(
|
|
466
|
-
# Path param: The ID of the run that requires the tool output submission.
|
|
467
|
-
run_id,
|
|
468
|
-
# Path param: The ID of the
|
|
469
|
-
# [thread](https://developers.openai.com/api/docs/assistants/migration) to which
|
|
470
|
-
# this run belongs.
|
|
471
|
-
thread_id:,
|
|
472
|
-
# Body param: A list of tools for which the outputs are being submitted.
|
|
473
|
-
tool_outputs:,
|
|
474
|
-
# There is no need to provide `stream:`. Instead, use
|
|
475
|
-
# `#submit_tool_outputs_stream_raw` or `#submit_tool_outputs` for streaming and
|
|
476
|
-
# non-streaming use cases, respectively.
|
|
477
|
-
stream: false,
|
|
478
|
-
request_options: {}
|
|
479
|
-
)
|
|
480
|
-
end
|
|
481
|
-
|
|
482
|
-
# See {OpenAI::Resources::Beta::Threads::Runs#submit_tool_outputs} for
|
|
483
|
-
# non-streaming counterpart.
|
|
484
|
-
#
|
|
485
|
-
# When a run has the `status: "requires_action"` and `required_action.type` is
|
|
486
|
-
# `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
|
|
487
|
-
# tool calls once they're all completed. All outputs must be submitted in a single
|
|
488
|
-
# request.
|
|
489
|
-
sig {
|
|
490
|
-
params(
|
|
491
|
-
run_id: String,
|
|
492
|
-
thread_id: String,
|
|
493
|
-
tool_outputs: T::Array[OpenAI::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput::OrHash],
|
|
494
|
-
stream: T.noreturn,
|
|
495
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
496
|
-
)
|
|
497
|
-
.returns(OpenAI::Internal::Stream[OpenAI::Beta::AssistantStreamEvent::Variants])
|
|
498
|
-
}
|
|
499
|
-
def submit_tool_outputs_stream_raw(
|
|
500
|
-
# Path param: The ID of the run that requires the tool output submission.
|
|
501
|
-
run_id,
|
|
502
|
-
# Path param: The ID of the
|
|
503
|
-
# [thread](https://developers.openai.com/api/docs/assistants/migration) to which
|
|
504
|
-
# this run belongs.
|
|
505
|
-
thread_id:,
|
|
506
|
-
# Body param: A list of tools for which the outputs are being submitted.
|
|
507
|
-
tool_outputs:,
|
|
508
|
-
# There is no need to provide `stream:`. Instead, use
|
|
509
|
-
# `#submit_tool_outputs_stream_raw` or `#submit_tool_outputs` for streaming and
|
|
510
|
-
# non-streaming use cases, respectively.
|
|
511
|
-
stream: true,
|
|
512
|
-
request_options: {}
|
|
513
|
-
)
|
|
514
|
-
end
|
|
515
|
-
|
|
516
|
-
# @api private
|
|
517
|
-
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
518
|
-
def self.new(client:)
|
|
519
|
-
end
|
|
520
|
-
end
|
|
521
|
-
|
|
522
|
-
end
|
|
523
|
-
|
|
524
|
-
end
|
|
525
|
-
|
|
526
|
-
end
|
|
527
|
-
end
|