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,825 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module OpenAI
|
|
4
|
-
module Models
|
|
5
|
-
|
|
6
|
-
module Beta
|
|
7
|
-
|
|
8
|
-
module Threads
|
|
9
|
-
|
|
10
|
-
class RunCreateParams < OpenAI::Internal::Type::BaseModel
|
|
11
|
-
|
|
12
|
-
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
13
|
-
include OpenAI::Internal::Type::RequestParameters
|
|
14
|
-
|
|
15
|
-
OrHash = T.type_alias do
|
|
16
|
-
T.any(
|
|
17
|
-
OpenAI::Beta::Threads::RunCreateParams,
|
|
18
|
-
OpenAI::Internal::AnyHash
|
|
19
|
-
)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
sig { returns(String) }
|
|
23
|
-
attr_accessor :thread_id
|
|
24
|
-
|
|
25
|
-
# The ID of the
|
|
26
|
-
# [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
|
|
27
|
-
# to execute this run.
|
|
28
|
-
sig { returns(String) }
|
|
29
|
-
attr_accessor :assistant_id
|
|
30
|
-
|
|
31
|
-
# A list of additional fields to include in the response. Currently the only
|
|
32
|
-
# supported value is `step_details.tool_calls[*].file_search.results[*].content`
|
|
33
|
-
# to fetch the file search result content.
|
|
34
|
-
#
|
|
35
|
-
# See the
|
|
36
|
-
# [file search tool documentation](https://developers.openai.com/api/docs/guides/tools-file-search#retrieval-customization)
|
|
37
|
-
# for more information.
|
|
38
|
-
sig { returns(T.nilable(T::Array[OpenAI::Beta::Threads::Runs::RunStepInclude::OrSymbol])) }
|
|
39
|
-
attr_reader :include
|
|
40
|
-
|
|
41
|
-
sig { params(include: T::Array[OpenAI::Beta::Threads::Runs::RunStepInclude::OrSymbol]).void }
|
|
42
|
-
attr_writer :include
|
|
43
|
-
|
|
44
|
-
# Appends additional instructions at the end of the instructions for the run. This
|
|
45
|
-
# is useful for modifying the behavior on a per-run basis without overriding other
|
|
46
|
-
# instructions.
|
|
47
|
-
sig { returns(T.nilable(String)) }
|
|
48
|
-
attr_accessor :additional_instructions
|
|
49
|
-
|
|
50
|
-
# Adds additional messages to the thread before creating the run.
|
|
51
|
-
sig { returns(T.nilable(T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage])) }
|
|
52
|
-
attr_accessor :additional_messages
|
|
53
|
-
|
|
54
|
-
# Overrides the
|
|
55
|
-
# [instructions](https://developers.openai.com/api/docs/assistants/migration) of
|
|
56
|
-
# the assistant. This is useful for modifying the behavior on a per-run basis.
|
|
57
|
-
sig { returns(T.nilable(String)) }
|
|
58
|
-
attr_accessor :instructions
|
|
59
|
-
|
|
60
|
-
# The maximum number of completion tokens that may be used over the course of the
|
|
61
|
-
# run. The run will make a best effort to use only the number of completion tokens
|
|
62
|
-
# specified, across multiple turns of the run. If the run exceeds the number of
|
|
63
|
-
# completion tokens specified, the run will end with status `incomplete`. See
|
|
64
|
-
# `incomplete_details` for more info.
|
|
65
|
-
sig { returns(T.nilable(Integer)) }
|
|
66
|
-
attr_accessor :max_completion_tokens
|
|
67
|
-
|
|
68
|
-
# The maximum number of prompt tokens that may be used over the course of the run.
|
|
69
|
-
# The run will make a best effort to use only the number of prompt tokens
|
|
70
|
-
# specified, across multiple turns of the run. If the run exceeds the number of
|
|
71
|
-
# prompt tokens specified, the run will end with status `incomplete`. See
|
|
72
|
-
# `incomplete_details` for more info.
|
|
73
|
-
sig { returns(T.nilable(Integer)) }
|
|
74
|
-
attr_accessor :max_prompt_tokens
|
|
75
|
-
|
|
76
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
77
|
-
# for storing additional information about the object in a structured format, and
|
|
78
|
-
# querying for objects via API or the dashboard.
|
|
79
|
-
#
|
|
80
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
81
|
-
# a maximum length of 512 characters.
|
|
82
|
-
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
83
|
-
attr_accessor :metadata
|
|
84
|
-
|
|
85
|
-
# The ID of the
|
|
86
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
87
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
88
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
89
|
-
# will be used.
|
|
90
|
-
sig { returns(T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol))) }
|
|
91
|
-
attr_accessor :model
|
|
92
|
-
|
|
93
|
-
# Whether to enable
|
|
94
|
-
# [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
|
|
95
|
-
# during tool use.
|
|
96
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
97
|
-
attr_reader :parallel_tool_calls
|
|
98
|
-
|
|
99
|
-
sig { params(parallel_tool_calls: T::Boolean).void }
|
|
100
|
-
attr_writer :parallel_tool_calls
|
|
101
|
-
|
|
102
|
-
# Constrains effort on reasoning for reasoning models. Currently supported values
|
|
103
|
-
# are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
|
|
104
|
-
# reasoning effort can result in faster responses and fewer tokens used on
|
|
105
|
-
# reasoning in a response. Not all reasoning models support every value. See the
|
|
106
|
-
# [reasoning guide](https://developers.openai.com/api/docs/guides/reasoning) for
|
|
107
|
-
# model-specific support.
|
|
108
|
-
sig { returns(T.nilable(OpenAI::ReasoningEffort::OrSymbol)) }
|
|
109
|
-
attr_accessor :reasoning_effort
|
|
110
|
-
|
|
111
|
-
# Specifies the format that the model must output. Compatible with
|
|
112
|
-
# [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
|
|
113
|
-
# [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
|
|
114
|
-
# all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
115
|
-
#
|
|
116
|
-
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
117
|
-
# Outputs which ensures the model will match your supplied JSON schema. Learn more
|
|
118
|
-
# in the
|
|
119
|
-
# [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
120
|
-
#
|
|
121
|
-
# Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
|
122
|
-
# message the model generates is valid JSON.
|
|
123
|
-
#
|
|
124
|
-
# **Important:** when using JSON mode, you **must** also instruct the model to
|
|
125
|
-
# produce JSON yourself via a system or user message. Without this, the model may
|
|
126
|
-
# generate an unending stream of whitespace until the generation reaches the token
|
|
127
|
-
# limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
128
|
-
# the message content may be partially cut off if `finish_reason="length"`, which
|
|
129
|
-
# indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
130
|
-
# max context length.
|
|
131
|
-
sig {
|
|
132
|
-
returns(
|
|
133
|
-
T.nilable(
|
|
134
|
-
T.any(
|
|
135
|
-
Symbol,
|
|
136
|
-
OpenAI::ResponseFormatText,
|
|
137
|
-
OpenAI::ResponseFormatJSONObject,
|
|
138
|
-
OpenAI::ResponseFormatJSONSchema
|
|
139
|
-
)
|
|
140
|
-
)
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
attr_accessor :response_format
|
|
144
|
-
|
|
145
|
-
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
146
|
-
# make the output more random, while lower values like 0.2 will make it more
|
|
147
|
-
# focused and deterministic.
|
|
148
|
-
sig { returns(T.nilable(Float)) }
|
|
149
|
-
attr_accessor :temperature
|
|
150
|
-
|
|
151
|
-
# Controls which (if any) tool is called by the model. `none` means the model will
|
|
152
|
-
# not call any tools and instead generates a message. `auto` is the default value
|
|
153
|
-
# and means the model can pick between generating a message or calling one or more
|
|
154
|
-
# tools. `required` means the model must call one or more tools before responding
|
|
155
|
-
# to the user. Specifying a particular tool like `{"type": "file_search"}` or
|
|
156
|
-
# `{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
|
157
|
-
# call that tool.
|
|
158
|
-
sig {
|
|
159
|
-
returns(
|
|
160
|
-
T.nilable(
|
|
161
|
-
T.any(OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol, OpenAI::Beta::AssistantToolChoice)
|
|
162
|
-
)
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
attr_accessor :tool_choice
|
|
166
|
-
|
|
167
|
-
# Override the tools the assistant can use for this run. This is useful for
|
|
168
|
-
# modifying the behavior on a per-run basis.
|
|
169
|
-
sig {
|
|
170
|
-
returns(
|
|
171
|
-
T.nilable(
|
|
172
|
-
T::Array[
|
|
173
|
-
T.any(OpenAI::Beta::CodeInterpreterTool, OpenAI::Beta::FileSearchTool, OpenAI::Beta::FunctionTool)
|
|
174
|
-
]
|
|
175
|
-
)
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
attr_accessor :tools
|
|
179
|
-
|
|
180
|
-
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
181
|
-
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
182
|
-
# means only the tokens comprising the top 10% probability mass are considered.
|
|
183
|
-
#
|
|
184
|
-
# We generally recommend altering this or temperature but not both.
|
|
185
|
-
sig { returns(T.nilable(Float)) }
|
|
186
|
-
attr_accessor :top_p
|
|
187
|
-
|
|
188
|
-
# Controls for how a thread will be truncated prior to the run. Use this to
|
|
189
|
-
# control the initial context window of the run.
|
|
190
|
-
sig { returns(T.nilable(OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy)) }
|
|
191
|
-
attr_reader :truncation_strategy
|
|
192
|
-
|
|
193
|
-
sig {
|
|
194
|
-
params(truncation_strategy: T.nilable(OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::OrHash))
|
|
195
|
-
.void
|
|
196
|
-
}
|
|
197
|
-
attr_writer :truncation_strategy
|
|
198
|
-
|
|
199
|
-
sig do
|
|
200
|
-
params(
|
|
201
|
-
|
|
202
|
-
thread_id: String,
|
|
203
|
-
|
|
204
|
-
assistant_id: String,
|
|
205
|
-
|
|
206
|
-
include: T::Array[OpenAI::Beta::Threads::Runs::RunStepInclude::OrSymbol],
|
|
207
|
-
|
|
208
|
-
additional_instructions: T.nilable(String),
|
|
209
|
-
|
|
210
|
-
additional_messages: T.nilable(
|
|
211
|
-
T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::OrHash]
|
|
212
|
-
),
|
|
213
|
-
|
|
214
|
-
instructions: T.nilable(String),
|
|
215
|
-
|
|
216
|
-
max_completion_tokens: T.nilable(Integer),
|
|
217
|
-
|
|
218
|
-
max_prompt_tokens: T.nilable(Integer),
|
|
219
|
-
|
|
220
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
221
|
-
|
|
222
|
-
model: T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol)),
|
|
223
|
-
|
|
224
|
-
parallel_tool_calls: T::Boolean,
|
|
225
|
-
|
|
226
|
-
reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
227
|
-
|
|
228
|
-
response_format: T.nilable(
|
|
229
|
-
T.any(
|
|
230
|
-
Symbol,
|
|
231
|
-
OpenAI::ResponseFormatText::OrHash,
|
|
232
|
-
OpenAI::ResponseFormatJSONObject::OrHash,
|
|
233
|
-
OpenAI::ResponseFormatJSONSchema::OrHash
|
|
234
|
-
)
|
|
235
|
-
),
|
|
236
|
-
|
|
237
|
-
temperature: T.nilable(Float),
|
|
238
|
-
|
|
239
|
-
tool_choice: T.nilable(
|
|
240
|
-
T.any(
|
|
241
|
-
OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol,
|
|
242
|
-
OpenAI::Beta::AssistantToolChoice::OrHash
|
|
243
|
-
)
|
|
244
|
-
),
|
|
245
|
-
|
|
246
|
-
tools: T.nilable(
|
|
247
|
-
T::Array[
|
|
248
|
-
T.any(
|
|
249
|
-
OpenAI::Beta::CodeInterpreterTool::OrHash,
|
|
250
|
-
OpenAI::Beta::FileSearchTool::OrHash,
|
|
251
|
-
OpenAI::Beta::FunctionTool::OrHash
|
|
252
|
-
)
|
|
253
|
-
]
|
|
254
|
-
),
|
|
255
|
-
|
|
256
|
-
top_p: T.nilable(Float),
|
|
257
|
-
|
|
258
|
-
truncation_strategy: T.nilable(OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::OrHash),
|
|
259
|
-
|
|
260
|
-
request_options: OpenAI::RequestOptions::OrHash
|
|
261
|
-
)
|
|
262
|
-
.returns(T.attached_class)
|
|
263
|
-
end
|
|
264
|
-
def self.new(
|
|
265
|
-
|
|
266
|
-
thread_id:,
|
|
267
|
-
|
|
268
|
-
# The ID of the
|
|
269
|
-
# [assistant](https://developers.openai.com/api/docs/assistants/migration) to use
|
|
270
|
-
# to execute this run.
|
|
271
|
-
assistant_id:,
|
|
272
|
-
|
|
273
|
-
# A list of additional fields to include in the response. Currently the only
|
|
274
|
-
# supported value is `step_details.tool_calls[*].file_search.results[*].content`
|
|
275
|
-
# to fetch the file search result content.
|
|
276
|
-
#
|
|
277
|
-
# See the
|
|
278
|
-
# [file search tool documentation](https://developers.openai.com/api/docs/guides/tools-file-search#retrieval-customization)
|
|
279
|
-
# for more information.
|
|
280
|
-
include: nil,
|
|
281
|
-
|
|
282
|
-
# Appends additional instructions at the end of the instructions for the run. This
|
|
283
|
-
# is useful for modifying the behavior on a per-run basis without overriding other
|
|
284
|
-
# instructions.
|
|
285
|
-
additional_instructions: nil,
|
|
286
|
-
|
|
287
|
-
# Adds additional messages to the thread before creating the run.
|
|
288
|
-
additional_messages: nil,
|
|
289
|
-
|
|
290
|
-
# Overrides the
|
|
291
|
-
# [instructions](https://developers.openai.com/api/docs/assistants/migration) of
|
|
292
|
-
# the assistant. This is useful for modifying the behavior on a per-run basis.
|
|
293
|
-
instructions: nil,
|
|
294
|
-
|
|
295
|
-
# The maximum number of completion tokens that may be used over the course of the
|
|
296
|
-
# run. The run will make a best effort to use only the number of completion tokens
|
|
297
|
-
# specified, across multiple turns of the run. If the run exceeds the number of
|
|
298
|
-
# completion tokens specified, the run will end with status `incomplete`. See
|
|
299
|
-
# `incomplete_details` for more info.
|
|
300
|
-
max_completion_tokens: nil,
|
|
301
|
-
|
|
302
|
-
# The maximum number of prompt tokens that may be used over the course of the run.
|
|
303
|
-
# The run will make a best effort to use only the number of prompt tokens
|
|
304
|
-
# specified, across multiple turns of the run. If the run exceeds the number of
|
|
305
|
-
# prompt tokens specified, the run will end with status `incomplete`. See
|
|
306
|
-
# `incomplete_details` for more info.
|
|
307
|
-
max_prompt_tokens: nil,
|
|
308
|
-
|
|
309
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
310
|
-
# for storing additional information about the object in a structured format, and
|
|
311
|
-
# querying for objects via API or the dashboard.
|
|
312
|
-
#
|
|
313
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
314
|
-
# a maximum length of 512 characters.
|
|
315
|
-
metadata: nil,
|
|
316
|
-
|
|
317
|
-
# The ID of the
|
|
318
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
319
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
320
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
321
|
-
# will be used.
|
|
322
|
-
model: nil,
|
|
323
|
-
|
|
324
|
-
# Whether to enable
|
|
325
|
-
# [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling)
|
|
326
|
-
# during tool use.
|
|
327
|
-
parallel_tool_calls: nil,
|
|
328
|
-
|
|
329
|
-
# Constrains effort on reasoning for reasoning models. Currently supported values
|
|
330
|
-
# are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing
|
|
331
|
-
# reasoning effort can result in faster responses and fewer tokens used on
|
|
332
|
-
# reasoning in a response. Not all reasoning models support every value. See the
|
|
333
|
-
# [reasoning guide](https://developers.openai.com/api/docs/guides/reasoning) for
|
|
334
|
-
# model-specific support.
|
|
335
|
-
reasoning_effort: nil,
|
|
336
|
-
|
|
337
|
-
# Specifies the format that the model must output. Compatible with
|
|
338
|
-
# [GPT-4o](https://developers.openai.com/api/docs/models/gpt-4o),
|
|
339
|
-
# [GPT-4 Turbo](https://developers.openai.com/api/docs/models/gpt-4-turbo), and
|
|
340
|
-
# all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
|
341
|
-
#
|
|
342
|
-
# Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
|
343
|
-
# Outputs which ensures the model will match your supplied JSON schema. Learn more
|
|
344
|
-
# in the
|
|
345
|
-
# [Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
346
|
-
#
|
|
347
|
-
# Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
|
348
|
-
# message the model generates is valid JSON.
|
|
349
|
-
#
|
|
350
|
-
# **Important:** when using JSON mode, you **must** also instruct the model to
|
|
351
|
-
# produce JSON yourself via a system or user message. Without this, the model may
|
|
352
|
-
# generate an unending stream of whitespace until the generation reaches the token
|
|
353
|
-
# limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
|
354
|
-
# the message content may be partially cut off if `finish_reason="length"`, which
|
|
355
|
-
# indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
|
356
|
-
# max context length.
|
|
357
|
-
response_format: nil,
|
|
358
|
-
|
|
359
|
-
# What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
|
360
|
-
# make the output more random, while lower values like 0.2 will make it more
|
|
361
|
-
# focused and deterministic.
|
|
362
|
-
temperature: nil,
|
|
363
|
-
|
|
364
|
-
# Controls which (if any) tool is called by the model. `none` means the model will
|
|
365
|
-
# not call any tools and instead generates a message. `auto` is the default value
|
|
366
|
-
# and means the model can pick between generating a message or calling one or more
|
|
367
|
-
# tools. `required` means the model must call one or more tools before responding
|
|
368
|
-
# to the user. Specifying a particular tool like `{"type": "file_search"}` or
|
|
369
|
-
# `{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
|
370
|
-
# call that tool.
|
|
371
|
-
tool_choice: nil,
|
|
372
|
-
|
|
373
|
-
# Override the tools the assistant can use for this run. This is useful for
|
|
374
|
-
# modifying the behavior on a per-run basis.
|
|
375
|
-
tools: nil,
|
|
376
|
-
|
|
377
|
-
# An alternative to sampling with temperature, called nucleus sampling, where the
|
|
378
|
-
# model considers the results of the tokens with top_p probability mass. So 0.1
|
|
379
|
-
# means only the tokens comprising the top 10% probability mass are considered.
|
|
380
|
-
#
|
|
381
|
-
# We generally recommend altering this or temperature but not both.
|
|
382
|
-
top_p: nil,
|
|
383
|
-
|
|
384
|
-
# Controls for how a thread will be truncated prior to the run. Use this to
|
|
385
|
-
# control the initial context window of the run.
|
|
386
|
-
truncation_strategy: nil,
|
|
387
|
-
|
|
388
|
-
request_options: {}
|
|
389
|
-
)
|
|
390
|
-
end
|
|
391
|
-
|
|
392
|
-
sig do
|
|
393
|
-
override.returns(
|
|
394
|
-
{
|
|
395
|
-
thread_id: String,
|
|
396
|
-
assistant_id: String,
|
|
397
|
-
include: T::Array[OpenAI::Beta::Threads::Runs::RunStepInclude::OrSymbol],
|
|
398
|
-
additional_instructions: T.nilable(String),
|
|
399
|
-
additional_messages: T.nilable(T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage]),
|
|
400
|
-
instructions: T.nilable(String),
|
|
401
|
-
max_completion_tokens: T.nilable(Integer),
|
|
402
|
-
max_prompt_tokens: T.nilable(Integer),
|
|
403
|
-
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
404
|
-
model: T.nilable(T.any(String, OpenAI::ChatModel::OrSymbol)),
|
|
405
|
-
parallel_tool_calls: T::Boolean,
|
|
406
|
-
reasoning_effort: T.nilable(OpenAI::ReasoningEffort::OrSymbol),
|
|
407
|
-
response_format: T.nilable(
|
|
408
|
-
T.any(
|
|
409
|
-
Symbol,
|
|
410
|
-
OpenAI::ResponseFormatText,
|
|
411
|
-
OpenAI::ResponseFormatJSONObject,
|
|
412
|
-
OpenAI::ResponseFormatJSONSchema
|
|
413
|
-
)
|
|
414
|
-
),
|
|
415
|
-
temperature: T.nilable(Float),
|
|
416
|
-
tool_choice: T.nilable(
|
|
417
|
-
T.any(OpenAI::Beta::AssistantToolChoiceOption::Auto::OrSymbol, OpenAI::Beta::AssistantToolChoice)
|
|
418
|
-
),
|
|
419
|
-
tools: T.nilable(
|
|
420
|
-
T::Array[
|
|
421
|
-
T.any(OpenAI::Beta::CodeInterpreterTool, OpenAI::Beta::FileSearchTool, OpenAI::Beta::FunctionTool)
|
|
422
|
-
]
|
|
423
|
-
),
|
|
424
|
-
top_p: T.nilable(Float),
|
|
425
|
-
truncation_strategy: T.nilable(OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy),
|
|
426
|
-
request_options: OpenAI::RequestOptions
|
|
427
|
-
}
|
|
428
|
-
)
|
|
429
|
-
end
|
|
430
|
-
def to_hash
|
|
431
|
-
end
|
|
432
|
-
|
|
433
|
-
class AdditionalMessage < OpenAI::Internal::Type::BaseModel
|
|
434
|
-
OrHash = T.type_alias do
|
|
435
|
-
T.any(
|
|
436
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage,
|
|
437
|
-
OpenAI::Internal::AnyHash
|
|
438
|
-
)
|
|
439
|
-
end
|
|
440
|
-
|
|
441
|
-
# The text contents of the message.
|
|
442
|
-
sig { returns(OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Content::Variants) }
|
|
443
|
-
attr_accessor :content
|
|
444
|
-
|
|
445
|
-
# The role of the entity that is creating the message. Allowed values include:
|
|
446
|
-
#
|
|
447
|
-
# - `user`: Indicates the message is sent by an actual user and should be used in
|
|
448
|
-
# most cases to represent user-generated messages.
|
|
449
|
-
# - `assistant`: Indicates the message is generated by the assistant. Use this
|
|
450
|
-
# value to insert messages from the assistant into the conversation.
|
|
451
|
-
sig { returns(OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Role::OrSymbol) }
|
|
452
|
-
attr_accessor :role
|
|
453
|
-
|
|
454
|
-
# A list of files attached to the message, and the tools they should be added to.
|
|
455
|
-
sig { returns(T.nilable(T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment])) }
|
|
456
|
-
attr_accessor :attachments
|
|
457
|
-
|
|
458
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
459
|
-
# for storing additional information about the object in a structured format, and
|
|
460
|
-
# querying for objects via API or the dashboard.
|
|
461
|
-
#
|
|
462
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
463
|
-
# a maximum length of 512 characters.
|
|
464
|
-
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
465
|
-
attr_accessor :metadata
|
|
466
|
-
|
|
467
|
-
sig do
|
|
468
|
-
params(
|
|
469
|
-
|
|
470
|
-
content: OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Content::Variants,
|
|
471
|
-
|
|
472
|
-
role: OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Role::OrSymbol,
|
|
473
|
-
|
|
474
|
-
attachments: T.nilable(
|
|
475
|
-
T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::OrHash]
|
|
476
|
-
),
|
|
477
|
-
|
|
478
|
-
metadata: T.nilable(T::Hash[Symbol, String])
|
|
479
|
-
)
|
|
480
|
-
.returns(T.attached_class)
|
|
481
|
-
end
|
|
482
|
-
def self.new(
|
|
483
|
-
|
|
484
|
-
# The text contents of the message.
|
|
485
|
-
content:,
|
|
486
|
-
|
|
487
|
-
# The role of the entity that is creating the message. Allowed values include:
|
|
488
|
-
#
|
|
489
|
-
# - `user`: Indicates the message is sent by an actual user and should be used in
|
|
490
|
-
# most cases to represent user-generated messages.
|
|
491
|
-
# - `assistant`: Indicates the message is generated by the assistant. Use this
|
|
492
|
-
# value to insert messages from the assistant into the conversation.
|
|
493
|
-
role:,
|
|
494
|
-
|
|
495
|
-
# A list of files attached to the message, and the tools they should be added to.
|
|
496
|
-
attachments: nil,
|
|
497
|
-
|
|
498
|
-
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
499
|
-
# for storing additional information about the object in a structured format, and
|
|
500
|
-
# querying for objects via API or the dashboard.
|
|
501
|
-
#
|
|
502
|
-
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
503
|
-
# a maximum length of 512 characters.
|
|
504
|
-
|
|
505
|
-
metadata: nil
|
|
506
|
-
)
|
|
507
|
-
end
|
|
508
|
-
|
|
509
|
-
sig do
|
|
510
|
-
override.returns(
|
|
511
|
-
{
|
|
512
|
-
content: OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Content::Variants,
|
|
513
|
-
role: OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Role::OrSymbol,
|
|
514
|
-
attachments: T.nilable(
|
|
515
|
-
T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment]
|
|
516
|
-
),
|
|
517
|
-
metadata: T.nilable(T::Hash[Symbol, String])
|
|
518
|
-
}
|
|
519
|
-
)
|
|
520
|
-
end
|
|
521
|
-
def to_hash
|
|
522
|
-
end
|
|
523
|
-
|
|
524
|
-
# The text contents of the message.
|
|
525
|
-
module Content
|
|
526
|
-
extend OpenAI::Internal::Type::Union
|
|
527
|
-
|
|
528
|
-
Variants = T.type_alias {
|
|
529
|
-
T.any(String, T::Array[OpenAI::Beta::Threads::MessageContentPartParam::Variants])
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
sig {
|
|
533
|
-
override.returns(T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Content::Variants])
|
|
534
|
-
}
|
|
535
|
-
def self.variants
|
|
536
|
-
end
|
|
537
|
-
|
|
538
|
-
MessageContentPartParamArray = T.let(
|
|
539
|
-
OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::Threads::MessageContentPartParam],
|
|
540
|
-
OpenAI::Internal::Type::Converter
|
|
541
|
-
)
|
|
542
|
-
|
|
543
|
-
end
|
|
544
|
-
|
|
545
|
-
# The role of the entity that is creating the message. Allowed values include:
|
|
546
|
-
#
|
|
547
|
-
# - `user`: Indicates the message is sent by an actual user and should be used in
|
|
548
|
-
# most cases to represent user-generated messages.
|
|
549
|
-
# - `assistant`: Indicates the message is generated by the assistant. Use this
|
|
550
|
-
# value to insert messages from the assistant into the conversation.
|
|
551
|
-
module Role
|
|
552
|
-
extend OpenAI::Internal::Type::Enum
|
|
553
|
-
|
|
554
|
-
TaggedSymbol = T.type_alias {
|
|
555
|
-
T.all(Symbol, OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Role)
|
|
556
|
-
}
|
|
557
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
558
|
-
|
|
559
|
-
USER = T.let(:user, OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Role::TaggedSymbol)
|
|
560
|
-
ASSISTANT = T.let(
|
|
561
|
-
:assistant,
|
|
562
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Role::TaggedSymbol
|
|
563
|
-
)
|
|
564
|
-
|
|
565
|
-
sig {
|
|
566
|
-
override.returns(
|
|
567
|
-
T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Role::TaggedSymbol]
|
|
568
|
-
)
|
|
569
|
-
}
|
|
570
|
-
def self.values
|
|
571
|
-
end
|
|
572
|
-
end
|
|
573
|
-
|
|
574
|
-
class Attachment < OpenAI::Internal::Type::BaseModel
|
|
575
|
-
OrHash = T.type_alias do
|
|
576
|
-
T.any(
|
|
577
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment,
|
|
578
|
-
OpenAI::Internal::AnyHash
|
|
579
|
-
)
|
|
580
|
-
end
|
|
581
|
-
|
|
582
|
-
# The ID of the file to attach to the message.
|
|
583
|
-
sig { returns(T.nilable(String)) }
|
|
584
|
-
attr_reader :file_id
|
|
585
|
-
|
|
586
|
-
sig { params(file_id: String).void }
|
|
587
|
-
attr_writer :file_id
|
|
588
|
-
|
|
589
|
-
# The tools to add this file to.
|
|
590
|
-
sig {
|
|
591
|
-
returns(
|
|
592
|
-
T.nilable(
|
|
593
|
-
T::Array[
|
|
594
|
-
T.any(
|
|
595
|
-
OpenAI::Beta::CodeInterpreterTool,
|
|
596
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool::FileSearch
|
|
597
|
-
)
|
|
598
|
-
]
|
|
599
|
-
)
|
|
600
|
-
)
|
|
601
|
-
}
|
|
602
|
-
attr_reader :tools
|
|
603
|
-
|
|
604
|
-
sig {
|
|
605
|
-
params(
|
|
606
|
-
tools: T::Array[
|
|
607
|
-
T.any(
|
|
608
|
-
OpenAI::Beta::CodeInterpreterTool::OrHash,
|
|
609
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool::FileSearch::OrHash
|
|
610
|
-
)
|
|
611
|
-
]
|
|
612
|
-
)
|
|
613
|
-
.void
|
|
614
|
-
}
|
|
615
|
-
attr_writer :tools
|
|
616
|
-
|
|
617
|
-
sig do
|
|
618
|
-
params(
|
|
619
|
-
|
|
620
|
-
file_id: String,
|
|
621
|
-
|
|
622
|
-
tools: T::Array[
|
|
623
|
-
T.any(
|
|
624
|
-
OpenAI::Beta::CodeInterpreterTool::OrHash,
|
|
625
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool::FileSearch::OrHash
|
|
626
|
-
)
|
|
627
|
-
]
|
|
628
|
-
)
|
|
629
|
-
.returns(T.attached_class)
|
|
630
|
-
end
|
|
631
|
-
def self.new(
|
|
632
|
-
|
|
633
|
-
# The ID of the file to attach to the message.
|
|
634
|
-
file_id: nil,
|
|
635
|
-
|
|
636
|
-
# The tools to add this file to.
|
|
637
|
-
|
|
638
|
-
tools: nil
|
|
639
|
-
)
|
|
640
|
-
end
|
|
641
|
-
|
|
642
|
-
sig do
|
|
643
|
-
override.returns(
|
|
644
|
-
{
|
|
645
|
-
file_id: String,
|
|
646
|
-
tools: T::Array[
|
|
647
|
-
T.any(
|
|
648
|
-
OpenAI::Beta::CodeInterpreterTool,
|
|
649
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool::FileSearch
|
|
650
|
-
)
|
|
651
|
-
]
|
|
652
|
-
}
|
|
653
|
-
)
|
|
654
|
-
end
|
|
655
|
-
def to_hash
|
|
656
|
-
end
|
|
657
|
-
|
|
658
|
-
module Tool
|
|
659
|
-
extend OpenAI::Internal::Type::Union
|
|
660
|
-
|
|
661
|
-
Variants = T.type_alias {
|
|
662
|
-
T.any(
|
|
663
|
-
OpenAI::Beta::CodeInterpreterTool,
|
|
664
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool::FileSearch
|
|
665
|
-
)
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
class FileSearch < OpenAI::Internal::Type::BaseModel
|
|
669
|
-
OrHash = T.type_alias do
|
|
670
|
-
T.any(
|
|
671
|
-
OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool::FileSearch,
|
|
672
|
-
OpenAI::Internal::AnyHash
|
|
673
|
-
)
|
|
674
|
-
end
|
|
675
|
-
|
|
676
|
-
# The type of tool being defined: `file_search`
|
|
677
|
-
sig { returns(Symbol) }
|
|
678
|
-
attr_accessor :type
|
|
679
|
-
|
|
680
|
-
sig do
|
|
681
|
-
params(
|
|
682
|
-
|
|
683
|
-
type: Symbol
|
|
684
|
-
)
|
|
685
|
-
.returns(T.attached_class)
|
|
686
|
-
end
|
|
687
|
-
def self.new(
|
|
688
|
-
|
|
689
|
-
# The type of tool being defined: `file_search`
|
|
690
|
-
|
|
691
|
-
type: :file_search
|
|
692
|
-
)
|
|
693
|
-
end
|
|
694
|
-
|
|
695
|
-
sig do
|
|
696
|
-
override.returns(
|
|
697
|
-
{type: Symbol}
|
|
698
|
-
)
|
|
699
|
-
end
|
|
700
|
-
def to_hash
|
|
701
|
-
end
|
|
702
|
-
|
|
703
|
-
end
|
|
704
|
-
|
|
705
|
-
sig {
|
|
706
|
-
override.returns(
|
|
707
|
-
T::Array[OpenAI::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool::Variants]
|
|
708
|
-
)
|
|
709
|
-
}
|
|
710
|
-
def self.variants
|
|
711
|
-
end
|
|
712
|
-
|
|
713
|
-
end
|
|
714
|
-
end
|
|
715
|
-
end
|
|
716
|
-
|
|
717
|
-
# The ID of the
|
|
718
|
-
# [Model](https://developers.openai.com/api/reference/resources/models) to be used
|
|
719
|
-
# to execute this run. If a value is provided here, it will override the model
|
|
720
|
-
# associated with the assistant. If not, the model associated with the assistant
|
|
721
|
-
# will be used.
|
|
722
|
-
module Model
|
|
723
|
-
extend OpenAI::Internal::Type::Union
|
|
724
|
-
|
|
725
|
-
Variants = T.type_alias { T.any(String, OpenAI::ChatModel::TaggedSymbol) }
|
|
726
|
-
|
|
727
|
-
sig { override.returns(T::Array[OpenAI::Beta::Threads::RunCreateParams::Model::Variants]) }
|
|
728
|
-
def self.variants
|
|
729
|
-
end
|
|
730
|
-
|
|
731
|
-
end
|
|
732
|
-
|
|
733
|
-
class TruncationStrategy < OpenAI::Internal::Type::BaseModel
|
|
734
|
-
OrHash = T.type_alias do
|
|
735
|
-
T.any(
|
|
736
|
-
OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy,
|
|
737
|
-
OpenAI::Internal::AnyHash
|
|
738
|
-
)
|
|
739
|
-
end
|
|
740
|
-
|
|
741
|
-
# The truncation strategy to use for the thread. The default is `auto`. If set to
|
|
742
|
-
# `last_messages`, the thread will be truncated to the n most recent messages in
|
|
743
|
-
# the thread. When set to `auto`, messages in the middle of the thread will be
|
|
744
|
-
# dropped to fit the context length of the model, `max_prompt_tokens`.
|
|
745
|
-
sig { returns(OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::Type::OrSymbol) }
|
|
746
|
-
attr_accessor :type
|
|
747
|
-
|
|
748
|
-
# The number of most recent messages from the thread when constructing the context
|
|
749
|
-
# for the run.
|
|
750
|
-
sig { returns(T.nilable(Integer)) }
|
|
751
|
-
attr_accessor :last_messages
|
|
752
|
-
|
|
753
|
-
# Controls for how a thread will be truncated prior to the run. Use this to
|
|
754
|
-
# control the initial context window of the run.
|
|
755
|
-
sig do
|
|
756
|
-
params(
|
|
757
|
-
|
|
758
|
-
type: OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::Type::OrSymbol,
|
|
759
|
-
|
|
760
|
-
last_messages: T.nilable(Integer)
|
|
761
|
-
)
|
|
762
|
-
.returns(T.attached_class)
|
|
763
|
-
end
|
|
764
|
-
def self.new(
|
|
765
|
-
|
|
766
|
-
# The truncation strategy to use for the thread. The default is `auto`. If set to
|
|
767
|
-
# `last_messages`, the thread will be truncated to the n most recent messages in
|
|
768
|
-
# the thread. When set to `auto`, messages in the middle of the thread will be
|
|
769
|
-
# dropped to fit the context length of the model, `max_prompt_tokens`.
|
|
770
|
-
type:,
|
|
771
|
-
|
|
772
|
-
# The number of most recent messages from the thread when constructing the context
|
|
773
|
-
# for the run.
|
|
774
|
-
|
|
775
|
-
last_messages: nil
|
|
776
|
-
)
|
|
777
|
-
end
|
|
778
|
-
|
|
779
|
-
sig do
|
|
780
|
-
override.returns(
|
|
781
|
-
{
|
|
782
|
-
type: OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::Type::OrSymbol,
|
|
783
|
-
last_messages: T.nilable(Integer)
|
|
784
|
-
}
|
|
785
|
-
)
|
|
786
|
-
end
|
|
787
|
-
def to_hash
|
|
788
|
-
end
|
|
789
|
-
|
|
790
|
-
# The truncation strategy to use for the thread. The default is `auto`. If set to
|
|
791
|
-
# `last_messages`, the thread will be truncated to the n most recent messages in
|
|
792
|
-
# the thread. When set to `auto`, messages in the middle of the thread will be
|
|
793
|
-
# dropped to fit the context length of the model, `max_prompt_tokens`.
|
|
794
|
-
module Type
|
|
795
|
-
extend OpenAI::Internal::Type::Enum
|
|
796
|
-
|
|
797
|
-
TaggedSymbol = T.type_alias {
|
|
798
|
-
T.all(Symbol, OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::Type)
|
|
799
|
-
}
|
|
800
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
801
|
-
|
|
802
|
-
AUTO = T.let(:auto, OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::Type::TaggedSymbol)
|
|
803
|
-
LAST_MESSAGES = T.let(
|
|
804
|
-
:last_messages,
|
|
805
|
-
OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::Type::TaggedSymbol
|
|
806
|
-
)
|
|
807
|
-
|
|
808
|
-
sig {
|
|
809
|
-
override.returns(
|
|
810
|
-
T::Array[OpenAI::Beta::Threads::RunCreateParams::TruncationStrategy::Type::TaggedSymbol]
|
|
811
|
-
)
|
|
812
|
-
}
|
|
813
|
-
def self.values
|
|
814
|
-
end
|
|
815
|
-
end
|
|
816
|
-
end
|
|
817
|
-
|
|
818
|
-
end
|
|
819
|
-
|
|
820
|
-
end
|
|
821
|
-
|
|
822
|
-
end
|
|
823
|
-
|
|
824
|
-
end
|
|
825
|
-
end
|