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,391 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module OpenAI
|
|
4
|
-
module Resources
|
|
5
|
-
|
|
6
|
-
class Beta
|
|
7
|
-
|
|
8
|
-
# Build Assistants that can call models and use tools.
|
|
9
|
-
class Threads
|
|
10
|
-
|
|
11
|
-
# Build Assistants that can call models and use tools.
|
|
12
|
-
sig { returns(OpenAI::Resources::Beta::Threads::Runs) }
|
|
13
|
-
attr_reader :runs
|
|
14
|
-
|
|
15
|
-
# Build Assistants that can call models and use tools.
|
|
16
|
-
sig { returns(OpenAI::Resources::Beta::Threads::Messages) }
|
|
17
|
-
attr_reader :messages
|
|
18
|
-
|
|
19
|
-
# Create a thread.
|
|
20
|
-
sig {
|
|
21
|
-
params(
|
|
22
|
-
messages: T::Array[OpenAI::Beta::ThreadCreateParams::Message::OrHash],
|
|
23
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
24
|
-
tool_resources: T.nilable(OpenAI::Beta::ThreadCreateParams::ToolResources::OrHash),
|
|
25
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
26
|
-
)
|
|
27
|
-
.returns(OpenAI::Beta::Thread)
|
|
28
|
-
}
|
|
29
|
-
def create(
|
|
30
|
-
# A list of
|
|
31
|
-
# [messages](https://developers.openai.com/api/docs/assistants/migration) to start
|
|
32
|
-
# the thread with.
|
|
33
|
-
messages: nil,
|
|
34
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
35
|
-
# for storing additional information about the object in a structured format, and
|
|
36
|
-
# querying for objects via API or the dashboard.
|
|
37
|
-
#
|
|
38
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
39
|
-
# a maximum length of 512 characters.
|
|
40
|
-
metadata: nil,
|
|
41
|
-
# A set of resources that are made available to the assistant's tools in this
|
|
42
|
-
# thread. The resources are specific to the type of tool. For example, the
|
|
43
|
-
# `code_interpreter` tool requires a list of file IDs, while the `file_search`
|
|
44
|
-
# tool requires a list of vector store IDs.
|
|
45
|
-
tool_resources: nil,
|
|
46
|
-
request_options: {}
|
|
47
|
-
)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# Retrieves a thread.
|
|
51
|
-
sig {
|
|
52
|
-
params(thread_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(OpenAI::Beta::Thread)
|
|
53
|
-
}
|
|
54
|
-
def retrieve(
|
|
55
|
-
# The ID of the thread to retrieve.
|
|
56
|
-
thread_id,
|
|
57
|
-
request_options: {}
|
|
58
|
-
)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# Modifies a thread.
|
|
62
|
-
sig {
|
|
63
|
-
params(
|
|
64
|
-
thread_id: String,
|
|
65
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
66
|
-
tool_resources: T.nilable(OpenAI::Beta::ThreadUpdateParams::ToolResources::OrHash),
|
|
67
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
68
|
-
)
|
|
69
|
-
.returns(OpenAI::Beta::Thread)
|
|
70
|
-
}
|
|
71
|
-
def update(
|
|
72
|
-
# The ID of the thread to modify. Only the `metadata` can be modified.
|
|
73
|
-
thread_id,
|
|
74
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
75
|
-
# for storing additional information about the object in a structured format, and
|
|
76
|
-
# querying for objects via API or the dashboard.
|
|
77
|
-
#
|
|
78
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
79
|
-
# a maximum length of 512 characters.
|
|
80
|
-
metadata: nil,
|
|
81
|
-
# A set of resources that are made available to the assistant's tools in this
|
|
82
|
-
# thread. The resources are specific to the type of tool. For example, the
|
|
83
|
-
# `code_interpreter` tool requires a list of file IDs, while the `file_search`
|
|
84
|
-
# tool requires a list of vector store IDs.
|
|
85
|
-
tool_resources: nil,
|
|
86
|
-
request_options: {}
|
|
87
|
-
)
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# Delete a thread.
|
|
91
|
-
sig {
|
|
92
|
-
params(thread_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
93
|
-
OpenAI::Beta::ThreadDeleted
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
def delete(
|
|
97
|
-
# The ID of the thread to delete.
|
|
98
|
-
thread_id,
|
|
99
|
-
request_options: {}
|
|
100
|
-
)
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
# See {OpenAI::Resources::Beta::Threads#stream_raw} for streaming counterpart.
|
|
104
|
-
#
|
|
105
|
-
# Create a thread and run it in one request.
|
|
106
|
-
sig {
|
|
107
|
-
params(
|
|
108
|
-
assistant_id: String,
|
|
109
|
-
instructions: T.nilable(String),
|
|
110
|
-
max_completion_tokens: T.nilable(Integer),
|
|
111
|
-
max_prompt_tokens: T.nilable(Integer),
|
|
112
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
113
|
-
model: T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol)),
|
|
114
|
-
parallel_tool_calls: T::Boolean,
|
|
115
|
-
response_format: T.nilable(
|
|
116
|
-
T.any(
|
|
117
|
-
Symbol,
|
|
118
|
-
OpenAI::ResponseFormatText::OrHash,
|
|
119
|
-
OpenAI::ResponseFormatJSONObject::OrHash,
|
|
120
|
-
OpenAI::ResponseFormatJSONSchema::OrHash
|
|
121
|
-
)
|
|
122
|
-
),
|
|
123
|
-
temperature: T.nilable(Float),
|
|
124
|
-
thread: OpenAI::Beta::ThreadCreateAndRunParams::Thread::OrHash,
|
|
125
|
-
tool_choice: T.nilable(
|
|
126
|
-
T.any(OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol, OpenAI::Beta::AssistantToolChoice::OrHash)
|
|
127
|
-
),
|
|
128
|
-
tool_resources: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::OrHash),
|
|
129
|
-
tools: T.nilable(
|
|
130
|
-
T::Array[
|
|
131
|
-
T.any(
|
|
132
|
-
OpenAI::Beta::CodeInterpreterTool::OrHash,
|
|
133
|
-
OpenAI::Beta::FileSearchTool::OrHash,
|
|
134
|
-
OpenAI::Beta::FunctionTool::OrHash
|
|
135
|
-
)
|
|
136
|
-
]
|
|
137
|
-
),
|
|
138
|
-
top_p: T.nilable(Float),
|
|
139
|
-
truncation_strategy: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::OrHash),
|
|
140
|
-
stream: T.noreturn,
|
|
141
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
142
|
-
)
|
|
143
|
-
.returns(OpenAI::Beta::Threads::Run)
|
|
144
|
-
}
|
|
145
|
-
def create_and_run(
|
|
146
|
-
# The ID of the
|
|
147
|
-
# [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
|
|
148
|
-
# to execute this run.
|
|
149
|
-
assistant_id:,
|
|
150
|
-
# Override the default system message of the assistant. This is useful for
|
|
151
|
-
# modifying the behavior on a per-run basis.
|
|
152
|
-
instructions: nil,
|
|
153
|
-
# The maximum number of completion tokens that may be used over the course of the
|
|
154
|
-
# run. The run will make a best effort to use only the number of completion tokens
|
|
155
|
-
# specified, across multiple turns of the run. If the run exceeds the number of
|
|
156
|
-
# completion tokens specified, the run will end with status `incomplete`. See
|
|
157
|
-
# `incomplete_details` for more info.
|
|
158
|
-
max_completion_tokens: nil,
|
|
159
|
-
# The maximum number of prompt tokens that may be used over the course of the run.
|
|
160
|
-
# The run will make a best effort to use only the number of prompt tokens
|
|
161
|
-
# specified, across multiple turns of the run. If the run exceeds the number of
|
|
162
|
-
# prompt tokens specified, the run will end with status `incomplete`. See
|
|
163
|
-
# `incomplete_details` for more info.
|
|
164
|
-
max_prompt_tokens: nil,
|
|
165
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
166
|
-
# for storing additional information about the object in a structured format, and
|
|
167
|
-
# querying for objects via API or the dashboard.
|
|
168
|
-
#
|
|
169
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
170
|
-
# a maximum length of 512 characters.
|
|
171
|
-
metadata: nil,
|
|
172
|
-
# The ID of the
|
|
173
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
174
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
175
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
176
|
-
# will be used.
|
|
177
|
-
model: nil,
|
|
178
|
-
# Whether to enable
|
|
179
|
-
# [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
|
|
180
|
-
# during tool use.
|
|
181
|
-
parallel_tool_calls: nil,
|
|
182
|
-
# Specifies the format that the model must output. Compatible with
|
|
183
|
-
# [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
|
|
184
|
-
# [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
|
|
185
|
-
# all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
186
|
-
#
|
|
187
|
-
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
188
|
-
# Outputs which ensures the model will match your supplied JSON schema. Learn more
|
|
189
|
-
# in the
|
|
190
|
-
# [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
191
|
-
#
|
|
192
|
-
# Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
|
193
|
-
# message the model generates is valid JSON.
|
|
194
|
-
#
|
|
195
|
-
# **Important:** when using JSON mode, you **must** also instruct the model to
|
|
196
|
-
# produce JSON yourself via a system or user message. Without this, the model may
|
|
197
|
-
# generate an unending stream of whitespace until the generation reaches the token
|
|
198
|
-
# limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
199
|
-
# the message content may be partially cut off if `finish_reason="length"`, which
|
|
200
|
-
# indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
201
|
-
# max context length.
|
|
202
|
-
response_format: nil,
|
|
203
|
-
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
204
|
-
# make the output more random, while lower values like 0.2 will make it more
|
|
205
|
-
# focused and deterministic.
|
|
206
|
-
temperature: nil,
|
|
207
|
-
# Options to create a new thread. If no thread is provided when running a request,
|
|
208
|
-
# an empty thread will be created.
|
|
209
|
-
thread: nil,
|
|
210
|
-
# Controls which (if any) tool is called by the model. `none` means the model will
|
|
211
|
-
# not call any tools and instead generates a message. `auto` is the default value
|
|
212
|
-
# and means the model can pick between generating a message or calling one or more
|
|
213
|
-
# tools. `required` means the model must call one or more tools before responding
|
|
214
|
-
# to the user. Specifying a particular tool like `{"type": "file_search"}` or
|
|
215
|
-
# `{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
|
216
|
-
# call that tool.
|
|
217
|
-
tool_choice: nil,
|
|
218
|
-
# A set of resources that are used by the assistant's tools. The resources are
|
|
219
|
-
# specific to the type of tool. For example, the `code_interpreter` tool requires
|
|
220
|
-
# a list of file IDs, while the `file_search` tool requires a list of vector store
|
|
221
|
-
# IDs.
|
|
222
|
-
tool_resources: nil,
|
|
223
|
-
# Override the tools the assistant can use for this run. This is useful for
|
|
224
|
-
# modifying the behavior on a per-run basis.
|
|
225
|
-
tools: nil,
|
|
226
|
-
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
227
|
-
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
228
|
-
# means only the tokens comprising the top 10% probability mass are considered.
|
|
229
|
-
#
|
|
230
|
-
# We generally recommend altering this or temperature but not both.
|
|
231
|
-
top_p: nil,
|
|
232
|
-
# Controls for how a thread will be truncated prior to the run. Use this to
|
|
233
|
-
# control the initial context window of the run.
|
|
234
|
-
truncation_strategy: nil,
|
|
235
|
-
# There is no need to provide `stream:`. Instead, use `#stream_raw` or
|
|
236
|
-
# `#create_and_run` for streaming and non-streaming use cases, respectively.
|
|
237
|
-
stream: false,
|
|
238
|
-
request_options: {}
|
|
239
|
-
)
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
# See {OpenAI::Resources::Beta::Threads#create_and_run} for non-streaming
|
|
243
|
-
# counterpart.
|
|
244
|
-
#
|
|
245
|
-
# Create a thread and run it in one request.
|
|
246
|
-
sig {
|
|
247
|
-
params(
|
|
248
|
-
assistant_id: String,
|
|
249
|
-
instructions: T.nilable(String),
|
|
250
|
-
max_completion_tokens: T.nilable(Integer),
|
|
251
|
-
max_prompt_tokens: T.nilable(Integer),
|
|
252
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
253
|
-
model: T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol)),
|
|
254
|
-
parallel_tool_calls: T::Boolean,
|
|
255
|
-
response_format: T.nilable(
|
|
256
|
-
T.any(
|
|
257
|
-
Symbol,
|
|
258
|
-
OpenAI::ResponseFormatText::OrHash,
|
|
259
|
-
OpenAI::ResponseFormatJSONObject::OrHash,
|
|
260
|
-
OpenAI::ResponseFormatJSONSchema::OrHash
|
|
261
|
-
)
|
|
262
|
-
),
|
|
263
|
-
temperature: T.nilable(Float),
|
|
264
|
-
thread: OpenAI::Beta::ThreadCreateAndRunParams::Thread::OrHash,
|
|
265
|
-
tool_choice: T.nilable(
|
|
266
|
-
T.any(OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol, OpenAI::Beta::AssistantToolChoice::OrHash)
|
|
267
|
-
),
|
|
268
|
-
tool_resources: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::ToolResources::OrHash),
|
|
269
|
-
tools: T.nilable(
|
|
270
|
-
T::Array[
|
|
271
|
-
T.any(
|
|
272
|
-
OpenAI::Beta::CodeInterpreterTool::OrHash,
|
|
273
|
-
OpenAI::Beta::FileSearchTool::OrHash,
|
|
274
|
-
OpenAI::Beta::FunctionTool::OrHash
|
|
275
|
-
)
|
|
276
|
-
]
|
|
277
|
-
),
|
|
278
|
-
top_p: T.nilable(Float),
|
|
279
|
-
truncation_strategy: T.nilable(OpenAI::Beta::ThreadCreateAndRunParams::TruncationStrategy::OrHash),
|
|
280
|
-
stream: T.noreturn,
|
|
281
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
282
|
-
)
|
|
283
|
-
.returns(OpenAI::Internal::Stream[OpenAI::Beta::AssistantStreamEvent::Variants])
|
|
284
|
-
}
|
|
285
|
-
def stream_raw(
|
|
286
|
-
# The ID of the
|
|
287
|
-
# [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
|
|
288
|
-
# to execute this run.
|
|
289
|
-
assistant_id:,
|
|
290
|
-
# Override the default system message of the assistant. This is useful for
|
|
291
|
-
# modifying the behavior on a per-run basis.
|
|
292
|
-
instructions: nil,
|
|
293
|
-
# The maximum number of completion tokens that may be used over the course of the
|
|
294
|
-
# run. The run will make a best effort to use only the number of completion tokens
|
|
295
|
-
# specified, across multiple turns of the run. If the run exceeds the number of
|
|
296
|
-
# completion tokens specified, the run will end with status `incomplete`. See
|
|
297
|
-
# `incomplete_details` for more info.
|
|
298
|
-
max_completion_tokens: nil,
|
|
299
|
-
# The maximum number of prompt tokens that may be used over the course of the run.
|
|
300
|
-
# The run will make a best effort to use only the number of prompt tokens
|
|
301
|
-
# specified, across multiple turns of the run. If the run exceeds the number of
|
|
302
|
-
# prompt tokens specified, the run will end with status `incomplete`. See
|
|
303
|
-
# `incomplete_details` for more info.
|
|
304
|
-
max_prompt_tokens: nil,
|
|
305
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
306
|
-
# for storing additional information about the object in a structured format, and
|
|
307
|
-
# querying for objects via API or the dashboard.
|
|
308
|
-
#
|
|
309
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
310
|
-
# a maximum length of 512 characters.
|
|
311
|
-
metadata: nil,
|
|
312
|
-
# The ID of the
|
|
313
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
314
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
315
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
316
|
-
# will be used.
|
|
317
|
-
model: nil,
|
|
318
|
-
# Whether to enable
|
|
319
|
-
# [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
|
|
320
|
-
# during tool use.
|
|
321
|
-
parallel_tool_calls: nil,
|
|
322
|
-
# Specifies the format that the model must output. Compatible with
|
|
323
|
-
# [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
|
|
324
|
-
# [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
|
|
325
|
-
# all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
326
|
-
#
|
|
327
|
-
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
328
|
-
# Outputs which ensures the model will match your supplied JSON schema. Learn more
|
|
329
|
-
# in the
|
|
330
|
-
# [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
331
|
-
#
|
|
332
|
-
# Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
|
333
|
-
# message the model generates is valid JSON.
|
|
334
|
-
#
|
|
335
|
-
# **Important:** when using JSON mode, you **must** also instruct the model to
|
|
336
|
-
# produce JSON yourself via a system or user message. Without this, the model may
|
|
337
|
-
# generate an unending stream of whitespace until the generation reaches the token
|
|
338
|
-
# limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
339
|
-
# the message content may be partially cut off if `finish_reason="length"`, which
|
|
340
|
-
# indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
341
|
-
# max context length.
|
|
342
|
-
response_format: nil,
|
|
343
|
-
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
344
|
-
# make the output more random, while lower values like 0.2 will make it more
|
|
345
|
-
# focused and deterministic.
|
|
346
|
-
temperature: nil,
|
|
347
|
-
# Options to create a new thread. If no thread is provided when running a request,
|
|
348
|
-
# an empty thread will be created.
|
|
349
|
-
thread: nil,
|
|
350
|
-
# Controls which (if any) tool is called by the model. `none` means the model will
|
|
351
|
-
# not call any tools and instead generates a message. `auto` is the default value
|
|
352
|
-
# and means the model can pick between generating a message or calling one or more
|
|
353
|
-
# tools. `required` means the model must call one or more tools before responding
|
|
354
|
-
# to the user. Specifying a particular tool like `{"type": "file_search"}` or
|
|
355
|
-
# `{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
|
356
|
-
# call that tool.
|
|
357
|
-
tool_choice: nil,
|
|
358
|
-
# A set of resources that are used by the assistant's tools. The resources are
|
|
359
|
-
# specific to the type of tool. For example, the `code_interpreter` tool requires
|
|
360
|
-
# a list of file IDs, while the `file_search` tool requires a list of vector store
|
|
361
|
-
# IDs.
|
|
362
|
-
tool_resources: nil,
|
|
363
|
-
# Override the tools the assistant can use for this run. This is useful for
|
|
364
|
-
# modifying the behavior on a per-run basis.
|
|
365
|
-
tools: nil,
|
|
366
|
-
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
367
|
-
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
368
|
-
# means only the tokens comprising the top 10% probability mass are considered.
|
|
369
|
-
#
|
|
370
|
-
# We generally recommend altering this or temperature but not both.
|
|
371
|
-
top_p: nil,
|
|
372
|
-
# Controls for how a thread will be truncated prior to the run. Use this to
|
|
373
|
-
# control the initial context window of the run.
|
|
374
|
-
truncation_strategy: nil,
|
|
375
|
-
# There is no need to provide `stream:`. Instead, use `#stream_raw` or
|
|
376
|
-
# `#create_and_run` for streaming and non-streaming use cases, respectively.
|
|
377
|
-
stream: true,
|
|
378
|
-
request_options: {}
|
|
379
|
-
)
|
|
380
|
-
end
|
|
381
|
-
|
|
382
|
-
# @api private
|
|
383
|
-
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
384
|
-
def self.new(client:)
|
|
385
|
-
end
|
|
386
|
-
end
|
|
387
|
-
|
|
388
|
-
end
|
|
389
|
-
|
|
390
|
-
end
|
|
391
|
-
end
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module OpenAI
|
|
4
|
-
module Resources
|
|
5
|
-
|
|
6
|
-
class Videos
|
|
7
|
-
|
|
8
|
-
# Create a new video generation job from a prompt and optional reference assets.
|
|
9
|
-
sig {
|
|
10
|
-
params(
|
|
11
|
-
prompt: String,
|
|
12
|
-
input_reference: T.any(OpenAI::Internal::FileInput, OpenAI::ImageInputReferenceParam::OrHash),
|
|
13
|
-
model: T.any(String, OpenAI::VideoModel::OrSymbol),
|
|
14
|
-
seconds: OpenAI::VideoSeconds::OrSymbol,
|
|
15
|
-
size: OpenAI::VideoSize::OrSymbol,
|
|
16
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
17
|
-
)
|
|
18
|
-
.returns(OpenAI::Video)
|
|
19
|
-
}
|
|
20
|
-
def create(
|
|
21
|
-
# Text prompt that describes the video to generate.
|
|
22
|
-
prompt:,
|
|
23
|
-
# Optional reference asset upload or reference object that guides generation.
|
|
24
|
-
#
|
|
25
|
-
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
26
|
-
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
27
|
-
# content type.
|
|
28
|
-
input_reference: nil,
|
|
29
|
-
# The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
|
|
30
|
-
# to `sora-2`.
|
|
31
|
-
model: nil,
|
|
32
|
-
# Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.
|
|
33
|
-
seconds: nil,
|
|
34
|
-
# Output resolution formatted as width x height (allowed values: 720x1280,
|
|
35
|
-
# 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.
|
|
36
|
-
size: nil,
|
|
37
|
-
request_options: {}
|
|
38
|
-
)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# Fetch the latest metadata for a generated video.
|
|
42
|
-
sig { params(video_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(OpenAI::Video) }
|
|
43
|
-
def retrieve(
|
|
44
|
-
# The identifier of the video to retrieve.
|
|
45
|
-
video_id,
|
|
46
|
-
request_options: {}
|
|
47
|
-
)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# List recently generated videos for the current project.
|
|
51
|
-
sig {
|
|
52
|
-
params(
|
|
53
|
-
after: String,
|
|
54
|
-
limit: Integer,
|
|
55
|
-
order: OpenAI::VideoListParams::Order::OrSymbol,
|
|
56
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
57
|
-
)
|
|
58
|
-
.returns(OpenAI::Internal::ConversationCursorPage[OpenAI::Video])
|
|
59
|
-
}
|
|
60
|
-
def list(
|
|
61
|
-
# Identifier for the last item from the previous pagination request
|
|
62
|
-
after: nil,
|
|
63
|
-
# Number of items to retrieve
|
|
64
|
-
limit: nil,
|
|
65
|
-
# Sort order of results by timestamp. Use `asc` for ascending order or `desc` for
|
|
66
|
-
# descending order.
|
|
67
|
-
order: nil,
|
|
68
|
-
request_options: {}
|
|
69
|
-
)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
# Permanently delete a completed or failed video and its stored assets.
|
|
73
|
-
sig {
|
|
74
|
-
params(video_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
75
|
-
OpenAI::Models::VideoDeleteResponse
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
def delete(
|
|
79
|
-
# The identifier of the video to delete.
|
|
80
|
-
video_id,
|
|
81
|
-
request_options: {}
|
|
82
|
-
)
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
# Create a character from an uploaded video.
|
|
86
|
-
sig {
|
|
87
|
-
params(name: String, video: OpenAI::Internal::FileInput, request_options: OpenAI::RequestOptions::OrHash)
|
|
88
|
-
.returns(OpenAI::Models::VideoCreateCharacterResponse)
|
|
89
|
-
}
|
|
90
|
-
def create_character(
|
|
91
|
-
# Display name for this API character.
|
|
92
|
-
name:,
|
|
93
|
-
# Video file used to create a character.
|
|
94
|
-
#
|
|
95
|
-
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
96
|
-
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
97
|
-
# content type.
|
|
98
|
-
video:,
|
|
99
|
-
request_options: {}
|
|
100
|
-
)
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
# Download the generated video bytes or a derived preview asset.
|
|
104
|
-
#
|
|
105
|
-
# Streams the rendered video content for the specified video job.
|
|
106
|
-
sig {
|
|
107
|
-
params(
|
|
108
|
-
video_id: String,
|
|
109
|
-
variant: OpenAI::VideoDownloadContentParams::Variant::OrSymbol,
|
|
110
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
111
|
-
)
|
|
112
|
-
.returns(T.all(StringIO, OpenAI::ResponseCarrier))
|
|
113
|
-
}
|
|
114
|
-
def download_content(
|
|
115
|
-
# The identifier of the video whose media to download.
|
|
116
|
-
video_id,
|
|
117
|
-
# Which downloadable asset to return. Defaults to the MP4 video.
|
|
118
|
-
variant: nil,
|
|
119
|
-
request_options: {}
|
|
120
|
-
)
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
# Create a new video generation job by editing a source video or existing
|
|
124
|
-
# generated video.
|
|
125
|
-
sig {
|
|
126
|
-
params(
|
|
127
|
-
prompt: String,
|
|
128
|
-
video: T.any(OpenAI::Internal::FileInput, OpenAI::VideoEditParams::Video::VideoReferenceInputParam::OrHash),
|
|
129
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
130
|
-
)
|
|
131
|
-
.returns(OpenAI::Video)
|
|
132
|
-
}
|
|
133
|
-
def edit(
|
|
134
|
-
# Text prompt that describes how to edit the source video.
|
|
135
|
-
prompt:,
|
|
136
|
-
# Reference to the completed video to edit.
|
|
137
|
-
#
|
|
138
|
-
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
139
|
-
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
140
|
-
# content type.
|
|
141
|
-
video:,
|
|
142
|
-
request_options: {}
|
|
143
|
-
)
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
# Create an extension of a completed video.
|
|
147
|
-
sig {
|
|
148
|
-
params(
|
|
149
|
-
prompt: String,
|
|
150
|
-
seconds: OpenAI::VideoSeconds::OrSymbol,
|
|
151
|
-
video: T.any(OpenAI::Internal::FileInput, OpenAI::VideoExtendParams::Video::VideoReferenceInputParam::OrHash),
|
|
152
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
153
|
-
)
|
|
154
|
-
.returns(OpenAI::Video)
|
|
155
|
-
}
|
|
156
|
-
def extend_(
|
|
157
|
-
# Updated text prompt that directs the extension generation.
|
|
158
|
-
prompt:,
|
|
159
|
-
# Length of the newly generated extension segment in seconds (allowed values: 4,
|
|
160
|
-
# 8, 12, 16, 20).
|
|
161
|
-
seconds:,
|
|
162
|
-
# Reference to the completed video to extend.
|
|
163
|
-
#
|
|
164
|
-
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
165
|
-
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
166
|
-
# content type.
|
|
167
|
-
video:,
|
|
168
|
-
request_options: {}
|
|
169
|
-
)
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# Fetch a character.
|
|
173
|
-
sig {
|
|
174
|
-
params(character_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
175
|
-
OpenAI::Models::VideoGetCharacterResponse
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
def get_character(
|
|
179
|
-
# The identifier of the character to retrieve.
|
|
180
|
-
character_id,
|
|
181
|
-
request_options: {}
|
|
182
|
-
)
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
# Create a remix of a completed video using a refreshed prompt.
|
|
186
|
-
sig {
|
|
187
|
-
params(video_id: String, prompt: String, request_options: OpenAI::RequestOptions::OrHash).returns(OpenAI::Video)
|
|
188
|
-
}
|
|
189
|
-
def remix(
|
|
190
|
-
# The identifier of the completed video to remix.
|
|
191
|
-
video_id,
|
|
192
|
-
# Updated text prompt that directs the remix generation.
|
|
193
|
-
prompt:,
|
|
194
|
-
request_options: {}
|
|
195
|
-
)
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
# @api private
|
|
199
|
-
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
200
|
-
def self.new(client:)
|
|
201
|
-
end
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
end
|
|
205
|
-
end
|