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,623 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module OpenAI
|
|
4
|
-
module Resources
|
|
5
|
-
class Beta
|
|
6
|
-
class Threads
|
|
7
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
8
|
-
#
|
|
9
|
-
# Build Assistants that can call models and use tools.
|
|
10
|
-
class Runs
|
|
11
|
-
# Build Assistants that can call models and use tools.
|
|
12
|
-
# @return [OpenAI::Resources::Beta::Threads::Runs::Steps]
|
|
13
|
-
attr_reader :steps
|
|
14
|
-
|
|
15
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
16
|
-
#
|
|
17
|
-
# See {OpenAI::Resources::Beta::Threads::Runs#create_stream_raw} for streaming
|
|
18
|
-
# counterpart.
|
|
19
|
-
#
|
|
20
|
-
# Create a run.
|
|
21
|
-
#
|
|
22
|
-
# @overload create(thread_id, assistant_id:, include: nil, additional_instructions: nil, additional_messages: nil, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_choice: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {})
|
|
23
|
-
#
|
|
24
|
-
# @param thread_id [String]
|
|
25
|
-
# Path param: The ID of the thread to run.
|
|
26
|
-
#
|
|
27
|
-
# @param assistant_id [String]
|
|
28
|
-
# Body param: The ID of the
|
|
29
|
-
# [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
|
|
30
|
-
# to execute this run.
|
|
31
|
-
#
|
|
32
|
-
# @param include [Array<Symbol, OpenAI::Models::Beta::Threads::Runs::RunStepInclude>]
|
|
33
|
-
# Query param: A list of additional fields to include in the response. Currently
|
|
34
|
-
# the only supported value is
|
|
35
|
-
# `step_details.tool_calls[*].file_search.results[*].content` to fetch the file
|
|
36
|
-
# search result content.
|
|
37
|
-
#
|
|
38
|
-
# See the
|
|
39
|
-
# [file search tool documentation](https://developers.openai.com/api/docs/guides/tools-file-search#retrieval-customization)
|
|
40
|
-
# for more information.
|
|
41
|
-
#
|
|
42
|
-
# @param additional_instructions [String, nil]
|
|
43
|
-
# Body param: Appends additional instructions at the end of the instructions for
|
|
44
|
-
# the run. This is useful for modifying the behavior on a per-run basis without
|
|
45
|
-
# overriding other instructions.
|
|
46
|
-
#
|
|
47
|
-
# @param additional_messages [Array<OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage>, nil]
|
|
48
|
-
# Body param: Adds additional messages to the thread before creating the run.
|
|
49
|
-
#
|
|
50
|
-
# @param instructions [String, nil]
|
|
51
|
-
# Body param: Overrides the
|
|
52
|
-
# [instructions](https://developers.openai.com/api/docs/assistants/migration) of
|
|
53
|
-
# the assistant. This is useful for modifying the behavior on a per-run basis.
|
|
54
|
-
#
|
|
55
|
-
# @param max_completion_tokens [Integer, nil]
|
|
56
|
-
# Body param: The maximum number of completion tokens that may be used over the
|
|
57
|
-
# course of the run. The run will make a best effort to use only the number of
|
|
58
|
-
# completion tokens specified, across multiple turns of the run. If the run
|
|
59
|
-
# exceeds the number of completion tokens specified, the run will end with status
|
|
60
|
-
# `incomplete`. See `incomplete_details` for more info.
|
|
61
|
-
#
|
|
62
|
-
# @param max_prompt_tokens [Integer, nil]
|
|
63
|
-
# Body param: The maximum number of prompt tokens that may be used over the course
|
|
64
|
-
# of the run. The run will make a best effort to use only the number of prompt
|
|
65
|
-
# tokens specified, across multiple turns of the run. If the run exceeds the
|
|
66
|
-
# number of prompt tokens specified, the run will end with status `incomplete`.
|
|
67
|
-
# See `incomplete_details` for more info.
|
|
68
|
-
#
|
|
69
|
-
# @param metadata [Hash{Symbol=>String}, nil]
|
|
70
|
-
# Body param: Set of 16 key-value pairs that can be attached to an object. This
|
|
71
|
-
# can be useful for storing additional information about the object in a
|
|
72
|
-
# structured format, and querying for objects via API or the dashboard.
|
|
73
|
-
#
|
|
74
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
75
|
-
# a maximum length of 512 characters.
|
|
76
|
-
#
|
|
77
|
-
# @param model [String, Symbol, OpenAI::Models::ChatModel, nil]
|
|
78
|
-
# Body param: The ID of the
|
|
79
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
80
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
81
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
82
|
-
# will be used.
|
|
83
|
-
#
|
|
84
|
-
# @param parallel_tool_calls [Boolean]
|
|
85
|
-
# Body param: Whether to enable
|
|
86
|
-
# [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
|
|
87
|
-
# during tool use.
|
|
88
|
-
#
|
|
89
|
-
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
90
|
-
# Body param: Constrains effort on reasoning for reasoning models. Currently
|
|
91
|
-
# supported values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and
|
|
92
|
-
# `max`. Reducing reasoning effort can result in faster responses and fewer tokens
|
|
93
|
-
# used on reasoning in a response. Not all reasoning models support every value.
|
|
94
|
-
# See the
|
|
95
|
-
# [reasoning guide](https://developers.openai.com/api/docs/guides/reasoning) for
|
|
96
|
-
# model-specific support.
|
|
97
|
-
#
|
|
98
|
-
# @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil]
|
|
99
|
-
# Body param: Specifies the format that the model must output. Compatible with
|
|
100
|
-
# [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
|
|
101
|
-
# [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
|
|
102
|
-
# all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
103
|
-
#
|
|
104
|
-
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
105
|
-
# Outputs which ensures the model will match your supplied JSON schema. Learn more
|
|
106
|
-
# in the
|
|
107
|
-
# [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
108
|
-
#
|
|
109
|
-
# Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
|
110
|
-
# message the model generates is valid JSON.
|
|
111
|
-
#
|
|
112
|
-
# **Important:** when using JSON mode, you **must** also instruct the model to
|
|
113
|
-
# produce JSON yourself via a system or user message. Without this, the model may
|
|
114
|
-
# generate an unending stream of whitespace until the generation reaches the token
|
|
115
|
-
# limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
116
|
-
# the message content may be partially cut off if `finish_reason="length"`, which
|
|
117
|
-
# indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
118
|
-
# max context length.
|
|
119
|
-
#
|
|
120
|
-
# @param temperature [Float, nil]
|
|
121
|
-
# Body param: What sampling temperature to use, between 0 and 2. Higher values
|
|
122
|
-
# like 0.8 will make the output more random, while lower values like 0.2 will make
|
|
123
|
-
# it more focused and deterministic.
|
|
124
|
-
#
|
|
125
|
-
# @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil]
|
|
126
|
-
# Body param: Controls which (if any) tool is called by the model. `none` means
|
|
127
|
-
# the model will not call any tools and instead generates a message. `auto` is the
|
|
128
|
-
# default value and means the model can pick between generating a message or
|
|
129
|
-
# calling one or more tools. `required` means the model must call one or more
|
|
130
|
-
# tools before responding to the user. Specifying a particular tool like
|
|
131
|
-
# `{"type": "file_search"}` or
|
|
132
|
-
# `{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
|
133
|
-
# call that tool.
|
|
134
|
-
#
|
|
135
|
-
# @param tools [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::FileSearchTool, OpenAI::Models::Beta::FunctionTool>, nil]
|
|
136
|
-
# Body param: Override the tools the assistant can use for this run. This is
|
|
137
|
-
# useful for modifying the behavior on a per-run basis.
|
|
138
|
-
#
|
|
139
|
-
# @param top_p [Float, nil]
|
|
140
|
-
# Body param: An alternative to sampling with temperature, called nucleus
|
|
141
|
-
# sampling, where the model considers the results of the tokens with top_p
|
|
142
|
-
# probability mass. So 0.1 means only the tokens comprising the top 10%
|
|
143
|
-
# probability mass are considered.
|
|
144
|
-
#
|
|
145
|
-
# We generally recommend altering this or temperature but not both.
|
|
146
|
-
#
|
|
147
|
-
# @param truncation_strategy [OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, nil]
|
|
148
|
-
# Body param: Controls for how a thread will be truncated prior to the run. Use
|
|
149
|
-
# this to control the initial context window of the run.
|
|
150
|
-
#
|
|
151
|
-
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
152
|
-
#
|
|
153
|
-
# @return [OpenAI::Models::Beta::Threads::Run]
|
|
154
|
-
#
|
|
155
|
-
# @see OpenAI::Models::Beta::Threads::RunCreateParams
|
|
156
|
-
def create(thread_id, params)
|
|
157
|
-
query_params = [:include]
|
|
158
|
-
parsed, options = OpenAI::Beta::Threads::RunCreateParams.dump_request(params)
|
|
159
|
-
query = OpenAI::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
160
|
-
if parsed[:stream]
|
|
161
|
-
message = "Please use `#create_stream_raw` for the streaming use case."
|
|
162
|
-
raise ArgumentError.new(message)
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
@client.request(
|
|
166
|
-
method: :post,
|
|
167
|
-
path: ["threads/%1$s/runs", thread_id],
|
|
168
|
-
query: query,
|
|
169
|
-
headers: {"openai-beta" => "assistants=v2"},
|
|
170
|
-
body: parsed.except(*query_params),
|
|
171
|
-
model: OpenAI::Beta::Threads::Run,
|
|
172
|
-
security: {bearer_auth: true},
|
|
173
|
-
options: options
|
|
174
|
-
)
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
178
|
-
#
|
|
179
|
-
# See {OpenAI::Resources::Beta::Threads::Runs#create} for non-streaming
|
|
180
|
-
# counterpart.
|
|
181
|
-
#
|
|
182
|
-
# Create a run.
|
|
183
|
-
#
|
|
184
|
-
# @overload create_stream_raw(thread_id, assistant_id:, include: nil, additional_instructions: nil, additional_messages: nil, instructions: nil, max_completion_tokens: nil, max_prompt_tokens: nil, metadata: nil, model: nil, parallel_tool_calls: nil, reasoning_effort: nil, response_format: nil, temperature: nil, tool_choice: nil, tools: nil, top_p: nil, truncation_strategy: nil, request_options: {})
|
|
185
|
-
#
|
|
186
|
-
# @param thread_id [String]
|
|
187
|
-
# Path param: The ID of the thread to run.
|
|
188
|
-
#
|
|
189
|
-
# @param assistant_id [String]
|
|
190
|
-
# Body param: The ID of the
|
|
191
|
-
# [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
|
|
192
|
-
# to execute this run.
|
|
193
|
-
#
|
|
194
|
-
# @param include [Array<Symbol, OpenAI::Models::Beta::Threads::Runs::RunStepInclude>]
|
|
195
|
-
# Query param: A list of additional fields to include in the response. Currently
|
|
196
|
-
# the only supported value is
|
|
197
|
-
# `step_details.tool_calls[*].file_search.results[*].content` to fetch the file
|
|
198
|
-
# search result content.
|
|
199
|
-
#
|
|
200
|
-
# See the
|
|
201
|
-
# [file search tool documentation](https://developers.openai.com/api/docs/guides/tools-file-search#retrieval-customization)
|
|
202
|
-
# for more information.
|
|
203
|
-
#
|
|
204
|
-
# @param additional_instructions [String, nil]
|
|
205
|
-
# Body param: Appends additional instructions at the end of the instructions for
|
|
206
|
-
# the run. This is useful for modifying the behavior on a per-run basis without
|
|
207
|
-
# overriding other instructions.
|
|
208
|
-
#
|
|
209
|
-
# @param additional_messages [Array<OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage>, nil]
|
|
210
|
-
# Body param: Adds additional messages to the thread before creating the run.
|
|
211
|
-
#
|
|
212
|
-
# @param instructions [String, nil]
|
|
213
|
-
# Body param: Overrides the
|
|
214
|
-
# [instructions](https://developers.openai.com/api/docs/assistants/migration) of
|
|
215
|
-
# the assistant. This is useful for modifying the behavior on a per-run basis.
|
|
216
|
-
#
|
|
217
|
-
# @param max_completion_tokens [Integer, nil]
|
|
218
|
-
# Body param: The maximum number of completion tokens that may be used over the
|
|
219
|
-
# course of the run. The run will make a best effort to use only the number of
|
|
220
|
-
# completion tokens specified, across multiple turns of the run. If the run
|
|
221
|
-
# exceeds the number of completion tokens specified, the run will end with status
|
|
222
|
-
# `incomplete`. See `incomplete_details` for more info.
|
|
223
|
-
#
|
|
224
|
-
# @param max_prompt_tokens [Integer, nil]
|
|
225
|
-
# Body param: The maximum number of prompt tokens that may be used over the course
|
|
226
|
-
# of the run. The run will make a best effort to use only the number of prompt
|
|
227
|
-
# tokens specified, across multiple turns of the run. If the run exceeds the
|
|
228
|
-
# number of prompt tokens specified, the run will end with status `incomplete`.
|
|
229
|
-
# See `incomplete_details` for more info.
|
|
230
|
-
#
|
|
231
|
-
# @param metadata [Hash{Symbol=>String}, nil]
|
|
232
|
-
# Body param: Set of 16 key-value pairs that can be attached to an object. This
|
|
233
|
-
# can be useful for storing additional information about the object in a
|
|
234
|
-
# structured format, and querying for objects via API or the dashboard.
|
|
235
|
-
#
|
|
236
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
237
|
-
# a maximum length of 512 characters.
|
|
238
|
-
#
|
|
239
|
-
# @param model [String, Symbol, OpenAI::Models::ChatModel, nil]
|
|
240
|
-
# Body param: The ID of the
|
|
241
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
242
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
243
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
244
|
-
# will be used.
|
|
245
|
-
#
|
|
246
|
-
# @param parallel_tool_calls [Boolean]
|
|
247
|
-
# Body param: Whether to enable
|
|
248
|
-
# [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
|
|
249
|
-
# during tool use.
|
|
250
|
-
#
|
|
251
|
-
# @param reasoning_effort [Symbol, OpenAI::Models::ReasoningEffort, nil]
|
|
252
|
-
# Body param: Constrains effort on reasoning for reasoning models. Currently
|
|
253
|
-
# supported values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and
|
|
254
|
-
# `max`. Reducing reasoning effort can result in faster responses and fewer tokens
|
|
255
|
-
# used on reasoning in a response. Not all reasoning models support every value.
|
|
256
|
-
# See the
|
|
257
|
-
# [reasoning guide](https://developers.openai.com/api/docs/guides/reasoning) for
|
|
258
|
-
# model-specific support.
|
|
259
|
-
#
|
|
260
|
-
# @param response_format [Symbol, :auto, OpenAI::Models::ResponseFormatText, OpenAI::Models::ResponseFormatJSONObject, OpenAI::Models::ResponseFormatJSONSchema, nil]
|
|
261
|
-
# Body param: Specifies the format that the model must output. Compatible with
|
|
262
|
-
# [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
|
|
263
|
-
# [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
|
|
264
|
-
# all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
265
|
-
#
|
|
266
|
-
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
267
|
-
# Outputs which ensures the model will match your supplied JSON schema. Learn more
|
|
268
|
-
# in the
|
|
269
|
-
# [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
270
|
-
#
|
|
271
|
-
# Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
|
272
|
-
# message the model generates is valid JSON.
|
|
273
|
-
#
|
|
274
|
-
# **Important:** when using JSON mode, you **must** also instruct the model to
|
|
275
|
-
# produce JSON yourself via a system or user message. Without this, the model may
|
|
276
|
-
# generate an unending stream of whitespace until the generation reaches the token
|
|
277
|
-
# limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
278
|
-
# the message content may be partially cut off if `finish_reason="length"`, which
|
|
279
|
-
# indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
280
|
-
# max context length.
|
|
281
|
-
#
|
|
282
|
-
# @param temperature [Float, nil]
|
|
283
|
-
# Body param: What sampling temperature to use, between 0 and 2. Higher values
|
|
284
|
-
# like 0.8 will make the output more random, while lower values like 0.2 will make
|
|
285
|
-
# it more focused and deterministic.
|
|
286
|
-
#
|
|
287
|
-
# @param tool_choice [Symbol, OpenAI::Models::Beta::AssistantToolChoiceOption::Auto, OpenAI::Models::Beta::AssistantToolChoice, nil]
|
|
288
|
-
# Body param: Controls which (if any) tool is called by the model. `none` means
|
|
289
|
-
# the model will not call any tools and instead generates a message. `auto` is the
|
|
290
|
-
# default value and means the model can pick between generating a message or
|
|
291
|
-
# calling one or more tools. `required` means the model must call one or more
|
|
292
|
-
# tools before responding to the user. Specifying a particular tool like
|
|
293
|
-
# `{"type": "file_search"}` or
|
|
294
|
-
# `{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
|
295
|
-
# call that tool.
|
|
296
|
-
#
|
|
297
|
-
# @param tools [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::FileSearchTool, OpenAI::Models::Beta::FunctionTool>, nil]
|
|
298
|
-
# Body param: Override the tools the assistant can use for this run. This is
|
|
299
|
-
# useful for modifying the behavior on a per-run basis.
|
|
300
|
-
#
|
|
301
|
-
# @param top_p [Float, nil]
|
|
302
|
-
# Body param: An alternative to sampling with temperature, called nucleus
|
|
303
|
-
# sampling, where the model considers the results of the tokens with top_p
|
|
304
|
-
# probability mass. So 0.1 means only the tokens comprising the top 10%
|
|
305
|
-
# probability mass are considered.
|
|
306
|
-
#
|
|
307
|
-
# We generally recommend altering this or temperature but not both.
|
|
308
|
-
#
|
|
309
|
-
# @param truncation_strategy [OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, nil]
|
|
310
|
-
# Body param: Controls for how a thread will be truncated prior to the run. Use
|
|
311
|
-
# this to control the initial context window of the run.
|
|
312
|
-
#
|
|
313
|
-
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
314
|
-
#
|
|
315
|
-
# @return [OpenAI::Internal::Stream<OpenAI::Models::Beta::AssistantStreamEvent::ThreadCreated, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCreated, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunQueued, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunInProgress, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunRequiresAction, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCompleted, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunIncomplete, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunFailed, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCancelling, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCancelled, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunExpired, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCreated, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepInProgress, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepDelta, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCompleted, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepFailed, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCancelled, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepExpired, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageCreated, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageInProgress, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageDelta, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageCompleted, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageIncomplete, OpenAI::Models::Beta::AssistantStreamEvent::ErrorEvent>]
|
|
316
|
-
#
|
|
317
|
-
# @see OpenAI::Models::Beta::Threads::RunCreateParams
|
|
318
|
-
def create_stream_raw(thread_id, params)
|
|
319
|
-
query_params = [:include]
|
|
320
|
-
parsed, options = OpenAI::Beta::Threads::RunCreateParams.dump_request(params)
|
|
321
|
-
query = OpenAI::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
322
|
-
unless parsed.fetch(:stream, true)
|
|
323
|
-
message = "Please use `#create` for the non-streaming use case."
|
|
324
|
-
raise ArgumentError.new(message)
|
|
325
|
-
end
|
|
326
|
-
|
|
327
|
-
parsed.store(:stream, true)
|
|
328
|
-
@client.request(
|
|
329
|
-
method: :post,
|
|
330
|
-
path: ["threads/%1$s/runs", thread_id],
|
|
331
|
-
query: query,
|
|
332
|
-
headers: {
|
|
333
|
-
"openai-beta" => "assistants=v2",
|
|
334
|
-
"accept" => "text/event-stream",
|
|
335
|
-
"accept-encoding" => "identity"
|
|
336
|
-
},
|
|
337
|
-
body: parsed.except(*query_params),
|
|
338
|
-
stream: OpenAI::Internal::Stream,
|
|
339
|
-
model: OpenAI::Beta::AssistantStreamEvent,
|
|
340
|
-
security: {bearer_auth: true},
|
|
341
|
-
options: options
|
|
342
|
-
)
|
|
343
|
-
end
|
|
344
|
-
|
|
345
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
346
|
-
#
|
|
347
|
-
# Retrieves a run.
|
|
348
|
-
#
|
|
349
|
-
# @overload retrieve(run_id, thread_id:, request_options: {})
|
|
350
|
-
#
|
|
351
|
-
# @param run_id [String]
|
|
352
|
-
# The ID of the run to retrieve.
|
|
353
|
-
#
|
|
354
|
-
# @param thread_id [String]
|
|
355
|
-
# The ID of the
|
|
356
|
-
# [thread](https://developers.openai.com/api/docs/assistants/migration) that was
|
|
357
|
-
# run.
|
|
358
|
-
#
|
|
359
|
-
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
360
|
-
#
|
|
361
|
-
# @return [OpenAI::Models::Beta::Threads::Run]
|
|
362
|
-
#
|
|
363
|
-
# @see OpenAI::Models::Beta::Threads::RunRetrieveParams
|
|
364
|
-
def retrieve(run_id, params)
|
|
365
|
-
parsed, options = OpenAI::Beta::Threads::RunRetrieveParams.dump_request(params)
|
|
366
|
-
thread_id = parsed.delete(:thread_id) do
|
|
367
|
-
raise ArgumentError.new("missing required path argument #{_1}")
|
|
368
|
-
end
|
|
369
|
-
|
|
370
|
-
@client.request(
|
|
371
|
-
method: :get,
|
|
372
|
-
path: ["threads/%1$s/runs/%2$s", thread_id, run_id],
|
|
373
|
-
headers: {"openai-beta" => "assistants=v2"},
|
|
374
|
-
model: OpenAI::Beta::Threads::Run,
|
|
375
|
-
security: {bearer_auth: true},
|
|
376
|
-
options: options
|
|
377
|
-
)
|
|
378
|
-
end
|
|
379
|
-
|
|
380
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
381
|
-
#
|
|
382
|
-
# Modifies a run.
|
|
383
|
-
#
|
|
384
|
-
# @overload update(run_id, thread_id:, metadata: nil, request_options: {})
|
|
385
|
-
#
|
|
386
|
-
# @param run_id [String]
|
|
387
|
-
# Path param: The ID of the run to modify.
|
|
388
|
-
#
|
|
389
|
-
# @param thread_id [String]
|
|
390
|
-
# Path param: The ID of the
|
|
391
|
-
# [thread](https://developers.openai.com/api/docs/assistants/migration) that was
|
|
392
|
-
# run.
|
|
393
|
-
#
|
|
394
|
-
# @param metadata [Hash{Symbol=>String}, nil]
|
|
395
|
-
# Body param: Set of 16 key-value pairs that can be attached to an object. This
|
|
396
|
-
# can be useful for storing additional information about the object in a
|
|
397
|
-
# structured format, and querying for objects via API or the dashboard.
|
|
398
|
-
#
|
|
399
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
400
|
-
# a maximum length of 512 characters.
|
|
401
|
-
#
|
|
402
|
-
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
403
|
-
#
|
|
404
|
-
# @return [OpenAI::Models::Beta::Threads::Run]
|
|
405
|
-
#
|
|
406
|
-
# @see OpenAI::Models::Beta::Threads::RunUpdateParams
|
|
407
|
-
def update(run_id, params)
|
|
408
|
-
parsed, options = OpenAI::Beta::Threads::RunUpdateParams.dump_request(params)
|
|
409
|
-
thread_id = parsed.delete(:thread_id) do
|
|
410
|
-
raise ArgumentError.new("missing required path argument #{_1}")
|
|
411
|
-
end
|
|
412
|
-
|
|
413
|
-
@client.request(
|
|
414
|
-
method: :post,
|
|
415
|
-
path: ["threads/%1$s/runs/%2$s", thread_id, run_id],
|
|
416
|
-
headers: {"openai-beta" => "assistants=v2"},
|
|
417
|
-
body: parsed,
|
|
418
|
-
model: OpenAI::Beta::Threads::Run,
|
|
419
|
-
security: {bearer_auth: true},
|
|
420
|
-
options: options
|
|
421
|
-
)
|
|
422
|
-
end
|
|
423
|
-
|
|
424
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
425
|
-
#
|
|
426
|
-
# Returns a list of runs belonging to a thread.
|
|
427
|
-
#
|
|
428
|
-
# @overload list(thread_id, after: nil, before: nil, limit: nil, order: nil, request_options: {})
|
|
429
|
-
#
|
|
430
|
-
# @param thread_id [String]
|
|
431
|
-
# The ID of the thread the run belongs to.
|
|
432
|
-
#
|
|
433
|
-
# @param after [String]
|
|
434
|
-
# A cursor for use in pagination. `after` is an object ID that defines your place
|
|
435
|
-
# in the list. For instance, if you make a list request and receive 100 objects,
|
|
436
|
-
# ending with obj_foo, your subsequent call can include after=obj_foo in order to
|
|
437
|
-
# fetch the next page of the list.
|
|
438
|
-
#
|
|
439
|
-
# @param before [String]
|
|
440
|
-
# A cursor for use in pagination. `before` is an object ID that defines your place
|
|
441
|
-
# in the list. For instance, if you make a list request and receive 100 objects,
|
|
442
|
-
# starting with obj_foo, your subsequent call can include before=obj_foo in order
|
|
443
|
-
# to fetch the previous page of the list.
|
|
444
|
-
#
|
|
445
|
-
# @param limit [Integer]
|
|
446
|
-
# A limit on the number of objects to be returned. Limit can range between 1 and
|
|
447
|
-
# 100, and the default is 20.
|
|
448
|
-
#
|
|
449
|
-
# @param order [Symbol, OpenAI::Models::Beta::Threads::RunListParams::Order]
|
|
450
|
-
# Sort order by the `created_at` timestamp of the objects. `asc` for ascending
|
|
451
|
-
# order and `desc` for descending order.
|
|
452
|
-
#
|
|
453
|
-
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
454
|
-
#
|
|
455
|
-
# @return [OpenAI::Internal::CursorPage<OpenAI::Models::Beta::Threads::Run>]
|
|
456
|
-
#
|
|
457
|
-
# @see OpenAI::Models::Beta::Threads::RunListParams
|
|
458
|
-
def list(thread_id, params = {})
|
|
459
|
-
parsed, options = OpenAI::Beta::Threads::RunListParams.dump_request(params)
|
|
460
|
-
query = OpenAI::Internal::Util.encode_query_params(parsed)
|
|
461
|
-
@client.request(
|
|
462
|
-
method: :get,
|
|
463
|
-
path: ["threads/%1$s/runs", thread_id],
|
|
464
|
-
query: query,
|
|
465
|
-
headers: {"openai-beta" => "assistants=v2"},
|
|
466
|
-
page: OpenAI::Internal::CursorPage,
|
|
467
|
-
model: OpenAI::Beta::Threads::Run,
|
|
468
|
-
security: {bearer_auth: true},
|
|
469
|
-
options: options
|
|
470
|
-
)
|
|
471
|
-
end
|
|
472
|
-
|
|
473
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
474
|
-
#
|
|
475
|
-
# Cancels a run that is `in_progress`.
|
|
476
|
-
#
|
|
477
|
-
# @overload cancel(run_id, thread_id:, request_options: {})
|
|
478
|
-
#
|
|
479
|
-
# @param run_id [String]
|
|
480
|
-
# The ID of the run to cancel.
|
|
481
|
-
#
|
|
482
|
-
# @param thread_id [String]
|
|
483
|
-
# The ID of the thread to which this run belongs.
|
|
484
|
-
#
|
|
485
|
-
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
486
|
-
#
|
|
487
|
-
# @return [OpenAI::Models::Beta::Threads::Run]
|
|
488
|
-
#
|
|
489
|
-
# @see OpenAI::Models::Beta::Threads::RunCancelParams
|
|
490
|
-
def cancel(run_id, params)
|
|
491
|
-
parsed, options = OpenAI::Beta::Threads::RunCancelParams.dump_request(params)
|
|
492
|
-
thread_id = parsed.delete(:thread_id) do
|
|
493
|
-
raise ArgumentError.new("missing required path argument #{_1}")
|
|
494
|
-
end
|
|
495
|
-
|
|
496
|
-
@client.request(
|
|
497
|
-
method: :post,
|
|
498
|
-
path: ["threads/%1$s/runs/%2$s/cancel", thread_id, run_id],
|
|
499
|
-
headers: {"openai-beta" => "assistants=v2"},
|
|
500
|
-
model: OpenAI::Beta::Threads::Run,
|
|
501
|
-
security: {bearer_auth: true},
|
|
502
|
-
options: options
|
|
503
|
-
)
|
|
504
|
-
end
|
|
505
|
-
|
|
506
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
507
|
-
#
|
|
508
|
-
# See {OpenAI::Resources::Beta::Threads::Runs#submit_tool_outputs_stream_raw} for
|
|
509
|
-
# streaming counterpart.
|
|
510
|
-
#
|
|
511
|
-
# When a run has the `status: "requires_action"` and `required_action.type` is
|
|
512
|
-
# `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
|
|
513
|
-
# tool calls once they're all completed. All outputs must be submitted in a single
|
|
514
|
-
# request.
|
|
515
|
-
#
|
|
516
|
-
# @overload submit_tool_outputs(run_id, thread_id:, tool_outputs:, request_options: {})
|
|
517
|
-
#
|
|
518
|
-
# @param run_id [String]
|
|
519
|
-
# Path param: The ID of the run that requires the tool output submission.
|
|
520
|
-
#
|
|
521
|
-
# @param thread_id [String]
|
|
522
|
-
# Path param: The ID of the
|
|
523
|
-
# [thread](https://developers.openai.com/api/docs/assistants/migration) to which
|
|
524
|
-
# this run belongs.
|
|
525
|
-
#
|
|
526
|
-
# @param tool_outputs [Array<OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput>]
|
|
527
|
-
# Body param: A list of tools for which the outputs are being submitted.
|
|
528
|
-
#
|
|
529
|
-
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
530
|
-
#
|
|
531
|
-
# @return [OpenAI::Models::Beta::Threads::Run]
|
|
532
|
-
#
|
|
533
|
-
# @see OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams
|
|
534
|
-
def submit_tool_outputs(run_id, params)
|
|
535
|
-
parsed, options = OpenAI::Beta::Threads::RunSubmitToolOutputsParams.dump_request(params)
|
|
536
|
-
if parsed[:stream]
|
|
537
|
-
message = "Please use `#submit_tool_outputs_stream_raw` for the streaming use case."
|
|
538
|
-
raise ArgumentError.new(message)
|
|
539
|
-
end
|
|
540
|
-
|
|
541
|
-
thread_id = parsed.delete(:thread_id) do
|
|
542
|
-
raise ArgumentError.new("missing required path argument #{_1}")
|
|
543
|
-
end
|
|
544
|
-
|
|
545
|
-
@client.request(
|
|
546
|
-
method: :post,
|
|
547
|
-
path: ["threads/%1$s/runs/%2$s/submit_tool_outputs", thread_id, run_id],
|
|
548
|
-
headers: {"openai-beta" => "assistants=v2"},
|
|
549
|
-
body: parsed,
|
|
550
|
-
model: OpenAI::Beta::Threads::Run,
|
|
551
|
-
security: {bearer_auth: true},
|
|
552
|
-
options: options
|
|
553
|
-
)
|
|
554
|
-
end
|
|
555
|
-
|
|
556
|
-
# @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
557
|
-
#
|
|
558
|
-
# See {OpenAI::Resources::Beta::Threads::Runs#submit_tool_outputs} for
|
|
559
|
-
# non-streaming counterpart.
|
|
560
|
-
#
|
|
561
|
-
# When a run has the `status: "requires_action"` and `required_action.type` is
|
|
562
|
-
# `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
|
|
563
|
-
# tool calls once they're all completed. All outputs must be submitted in a single
|
|
564
|
-
# request.
|
|
565
|
-
#
|
|
566
|
-
# @overload submit_tool_outputs_stream_raw(run_id, thread_id:, tool_outputs:, request_options: {})
|
|
567
|
-
#
|
|
568
|
-
# @param run_id [String]
|
|
569
|
-
# Path param: The ID of the run that requires the tool output submission.
|
|
570
|
-
#
|
|
571
|
-
# @param thread_id [String]
|
|
572
|
-
# Path param: The ID of the
|
|
573
|
-
# [thread](https://developers.openai.com/api/docs/assistants/migration) to which
|
|
574
|
-
# this run belongs.
|
|
575
|
-
#
|
|
576
|
-
# @param tool_outputs [Array<OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput>]
|
|
577
|
-
# Body param: A list of tools for which the outputs are being submitted.
|
|
578
|
-
#
|
|
579
|
-
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
580
|
-
#
|
|
581
|
-
# @return [OpenAI::Internal::Stream<OpenAI::Models::Beta::AssistantStreamEvent::ThreadCreated, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCreated, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunQueued, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunInProgress, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunRequiresAction, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCompleted, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunIncomplete, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunFailed, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCancelling, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunCancelled, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunExpired, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCreated, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepInProgress, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepDelta, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCompleted, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepFailed, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepCancelled, OpenAI::Models::Beta::AssistantStreamEvent::ThreadRunStepExpired, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageCreated, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageInProgress, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageDelta, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageCompleted, OpenAI::Models::Beta::AssistantStreamEvent::ThreadMessageIncomplete, OpenAI::Models::Beta::AssistantStreamEvent::ErrorEvent>]
|
|
582
|
-
#
|
|
583
|
-
# @see OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams
|
|
584
|
-
def submit_tool_outputs_stream_raw(run_id, params)
|
|
585
|
-
parsed, options = OpenAI::Beta::Threads::RunSubmitToolOutputsParams.dump_request(params)
|
|
586
|
-
unless parsed.fetch(:stream, true)
|
|
587
|
-
message = "Please use `#submit_tool_outputs` for the non-streaming use case."
|
|
588
|
-
raise ArgumentError.new(message)
|
|
589
|
-
end
|
|
590
|
-
|
|
591
|
-
parsed.store(:stream, true)
|
|
592
|
-
thread_id = parsed.delete(:thread_id) do
|
|
593
|
-
raise ArgumentError.new("missing required path argument #{_1}")
|
|
594
|
-
end
|
|
595
|
-
|
|
596
|
-
@client.request(
|
|
597
|
-
method: :post,
|
|
598
|
-
path: ["threads/%1$s/runs/%2$s/submit_tool_outputs", thread_id, run_id],
|
|
599
|
-
headers: {
|
|
600
|
-
"openai-beta" => "assistants=v2",
|
|
601
|
-
"accept" => "text/event-stream",
|
|
602
|
-
"accept-encoding" => "identity"
|
|
603
|
-
},
|
|
604
|
-
body: parsed,
|
|
605
|
-
stream: OpenAI::Internal::Stream,
|
|
606
|
-
model: OpenAI::Beta::AssistantStreamEvent,
|
|
607
|
-
security: {bearer_auth: true},
|
|
608
|
-
options: options
|
|
609
|
-
)
|
|
610
|
-
end
|
|
611
|
-
|
|
612
|
-
# @api private
|
|
613
|
-
#
|
|
614
|
-
# @param client [OpenAI::Client]
|
|
615
|
-
def initialize(client:)
|
|
616
|
-
@client = client
|
|
617
|
-
@steps = OpenAI::Resources::Beta::Threads::Runs::Steps.new(client: client)
|
|
618
|
-
end
|
|
619
|
-
end
|
|
620
|
-
end
|
|
621
|
-
end
|
|
622
|
-
end
|
|
623
|
-
end
|