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