From 25eeb63aa4c0d6ebb5f5db5c42c0a531348ad781 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:25:43 +0000 Subject: [PATCH] chore: switch to prettier looking sorbet annotations --- rbi/lib/openai/base_client.rbi | 8 +- rbi/lib/openai/client.rbi | 51 +- rbi/lib/openai/cursor_page.rbi | 14 +- rbi/lib/openai/errors.rbi | 112 +--- .../models/audio/speech_create_params.rbi | 54 +- rbi/lib/openai/models/audio/transcription.rbi | 41 +- .../audio/transcription_create_params.rbi | 75 +-- .../models/audio/transcription_segment.rbi | 70 +-- .../audio/transcription_text_delta_event.rbi | 50 +- .../audio/transcription_text_done_event.rbi | 50 +- .../models/audio/transcription_verbose.rbi | 43 +- .../models/audio/transcription_word.rbi | 21 +- rbi/lib/openai/models/audio/translation.rbi | 7 +- .../audio/translation_create_params.rbi | 44 +- .../models/audio/translation_verbose.rbi | 32 +- .../auto_file_chunking_strategy_param.rbi | 7 +- rbi/lib/openai/models/batch.rbi | 179 ++---- rbi/lib/openai/models/batch_create_params.rbi | 34 +- rbi/lib/openai/models/batch_error.rbi | 30 +- rbi/lib/openai/models/batch_list_params.rbi | 16 +- .../openai/models/batch_request_counts.rbi | 21 +- rbi/lib/openai/models/beta/assistant.rbi | 176 ++---- .../models/beta/assistant_create_params.rbi | 254 ++------- .../openai/models/beta/assistant_deleted.rbi | 21 +- .../models/beta/assistant_list_params.rbi | 35 +- .../models/beta/assistant_stream_event.rbi | 440 ++++----------- .../models/beta/assistant_tool_choice.rbi | 21 +- .../beta/assistant_tool_choice_function.rbi | 7 +- .../models/beta/assistant_update_params.rbi | 162 ++---- .../models/beta/code_interpreter_tool.rbi | 7 +- .../openai/models/beta/file_search_tool.rbi | 56 +- rbi/lib/openai/models/beta/function_tool.rbi | 18 +- .../models/beta/message_stream_event.rbi | 90 +-- .../models/beta/run_step_stream_event.rbi | 126 +---- .../openai/models/beta/run_stream_event.rbi | 180 ++---- rbi/lib/openai/models/beta/thread.rbi | 78 +-- .../beta/thread_create_and_run_params.rbi | 512 ++++-------------- .../models/beta/thread_create_params.rbi | 252 ++------- rbi/lib/openai/models/beta/thread_deleted.rbi | 21 +- .../models/beta/thread_stream_event.rbi | 26 +- .../models/beta/thread_update_params.rbi | 55 +- .../beta/threads/file_citation_annotation.rbi | 45 +- .../file_citation_delta_annotation.rbi | 66 +-- .../beta/threads/file_path_annotation.rbi | 47 +- .../threads/file_path_delta_annotation.rbi | 58 +- .../openai/models/beta/threads/image_file.rbi | 18 +- .../beta/threads/image_file_content_block.rbi | 18 +- .../models/beta/threads/image_file_delta.rbi | 19 +- .../beta/threads/image_file_delta_block.rbi | 25 +- .../openai/models/beta/threads/image_url.rbi | 18 +- .../beta/threads/image_url_content_block.rbi | 18 +- .../models/beta/threads/image_url_delta.rbi | 19 +- .../beta/threads/image_url_delta_block.rbi | 25 +- .../openai/models/beta/threads/message.rbi | 176 +----- .../beta/threads/message_create_params.rbi | 92 +--- .../beta/threads/message_delete_params.rbi | 7 +- .../models/beta/threads/message_deleted.rbi | 21 +- .../models/beta/threads/message_delta.rbi | 31 +- .../beta/threads/message_delta_event.rbi | 25 +- .../beta/threads/message_list_params.rbi | 43 +- .../beta/threads/message_retrieve_params.rbi | 7 +- .../beta/threads/message_update_params.rbi | 14 +- .../beta/threads/refusal_content_block.rbi | 14 +- .../beta/threads/refusal_delta_block.rbi | 22 +- .../required_action_function_tool_call.rbi | 40 +- rbi/lib/openai/models/beta/threads/run.rbi | 366 +++---------- .../models/beta/threads/run_cancel_params.rbi | 7 +- .../models/beta/threads/run_create_params.rbi | 314 ++--------- .../models/beta/threads/run_list_params.rbi | 35 +- .../beta/threads/run_retrieve_params.rbi | 7 +- .../run_submit_tool_outputs_params.rbi | 33 +- .../models/beta/threads/run_update_params.rbi | 14 +- .../threads/runs/code_interpreter_logs.rbi | 22 +- .../runs/code_interpreter_output_image.rbi | 34 +- .../runs/code_interpreter_tool_call.rbi | 103 +--- .../runs/code_interpreter_tool_call_delta.rbi | 63 +-- .../threads/runs/file_search_tool_call.rbi | 130 +---- .../runs/file_search_tool_call_delta.rbi | 29 +- .../beta/threads/runs/function_tool_call.rbi | 47 +- .../threads/runs/function_tool_call_delta.rbi | 57 +- .../runs/message_creation_step_details.rbi | 29 +- .../models/beta/threads/runs/run_step.rbi | 177 +----- .../beta/threads/runs/run_step_delta.rbi | 16 +- .../threads/runs/run_step_delta_event.rbi | 25 +- .../runs/run_step_delta_message_delta.rbi | 30 +- .../beta/threads/runs/step_list_params.rbi | 53 +- .../threads/runs/step_retrieve_params.rbi | 25 +- .../threads/runs/tool_call_delta_object.rbi | 26 +- .../threads/runs/tool_calls_step_details.rbi | 33 +- rbi/lib/openai/models/beta/threads/text.rbi | 31 +- .../beta/threads/text_content_block.rbi | 18 +- .../beta/threads/text_content_block_param.rbi | 14 +- .../openai/models/beta/threads/text_delta.rbi | 26 +- .../models/beta/threads/text_delta_block.rbi | 25 +- .../openai/models/chat/chat_completion.rbi | 127 +---- ...hat_completion_assistant_message_param.rbi | 115 +--- .../models/chat/chat_completion_audio.rbi | 28 +- .../chat/chat_completion_audio_param.rbi | 20 +- .../models/chat/chat_completion_chunk.rbi | 246 ++------- .../chat/chat_completion_content_part.rbi | 41 +- .../chat_completion_content_part_image.rbi | 37 +- ...at_completion_content_part_input_audio.rbi | 36 +- .../chat_completion_content_part_refusal.rbi | 14 +- .../chat_completion_content_part_text.rbi | 14 +- .../models/chat/chat_completion_deleted.rbi | 21 +- ...hat_completion_developer_message_param.rbi | 25 +- .../chat_completion_function_call_option.rbi | 7 +- ...chat_completion_function_message_param.rbi | 21 +- .../models/chat/chat_completion_message.rbi | 129 ++--- .../chat_completion_message_tool_call.rbi | 40 +- .../chat_completion_named_tool_choice.rbi | 26 +- .../chat_completion_prediction_content.rbi | 17 +- .../chat/chat_completion_store_message.rbi | 7 +- .../chat/chat_completion_stream_options.rbi | 8 +- .../chat_completion_system_message_param.rbi | 25 +- .../chat/chat_completion_token_logprob.rbi | 52 +- .../models/chat/chat_completion_tool.rbi | 18 +- .../chat_completion_tool_message_param.rbi | 24 +- .../chat_completion_user_message_param.rbi | 49 +- .../models/chat/completion_create_params.rbi | 417 ++++---------- .../models/chat/completion_list_params.rbi | 42 +- .../models/chat/completion_update_params.rbi | 7 +- .../chat/completions/message_list_params.rbi | 27 +- rbi/lib/openai/models/comparison_filter.rbi | 24 +- rbi/lib/openai/models/completion.rbi | 54 +- rbi/lib/openai/models/completion_choice.rbi | 67 +-- .../models/completion_create_params.rbi | 140 +---- rbi/lib/openai/models/completion_usage.rbi | 93 ++-- rbi/lib/openai/models/compound_filter.rbi | 20 +- .../models/create_embedding_response.rbi | 46 +- rbi/lib/openai/models/embedding.rbi | 21 +- .../openai/models/embedding_create_params.rbi | 47 +- rbi/lib/openai/models/error_object.rbi | 28 +- rbi/lib/openai/models/file_create_params.rbi | 14 +- rbi/lib/openai/models/file_deleted.rbi | 21 +- rbi/lib/openai/models/file_list_params.rbi | 35 +- rbi/lib/openai/models/file_object.rbi | 71 +-- .../models/fine_tuning/fine_tuning_job.rbi | 313 +++-------- .../fine_tuning/fine_tuning_job_event.rbi | 57 +- .../fine_tuning_job_wandb_integration.rbi | 29 +- ...ne_tuning_job_wandb_integration_object.rbi | 18 +- .../models/fine_tuning/job_create_params.rbi | 267 +++------ .../fine_tuning/job_list_events_params.rbi | 16 +- .../models/fine_tuning/job_list_params.rbi | 23 +- .../jobs/checkpoint_list_params.rbi | 16 +- .../jobs/fine_tuning_job_checkpoint.rbi | 108 ++-- rbi/lib/openai/models/function_definition.rbi | 30 +- rbi/lib/openai/models/image.rbi | 24 +- .../models/image_create_variation_params.rbi | 52 +- rbi/lib/openai/models/image_edit_params.rbi | 67 +-- .../openai/models/image_generate_params.rbi | 73 +-- rbi/lib/openai/models/images_response.rbi | 14 +- rbi/lib/openai/models/model.rbi | 28 +- rbi/lib/openai/models/model_deleted.rbi | 21 +- rbi/lib/openai/models/moderation.rbi | 361 ++---------- .../models/moderation_create_params.rbi | 33 +- .../models/moderation_create_response.rbi | 21 +- .../models/moderation_image_url_input.rbi | 25 +- .../openai/models/moderation_text_input.rbi | 14 +- .../other_file_chunking_strategy_object.rbi | 7 +- rbi/lib/openai/models/reasoning.rbi | 20 +- .../models/response_format_json_object.rbi | 7 +- .../models/response_format_json_schema.rbi | 47 +- .../openai/models/response_format_text.rbi | 7 +- .../openai/models/responses/computer_tool.rbi | 31 +- .../models/responses/easy_input_message.rbi | 53 +- .../models/responses/file_search_tool.rbi | 65 +-- .../openai/models/responses/function_tool.rbi | 35 +- .../responses/input_item_list_params.rbi | 35 +- rbi/lib/openai/models/responses/response.rbi | 262 ++------- .../responses/response_audio_delta_event.rbi | 14 +- .../responses/response_audio_done_event.rbi | 7 +- .../response_audio_transcript_delta_event.rbi | 14 +- .../response_audio_transcript_done_event.rbi | 7 +- ...code_interpreter_call_code_delta_event.rbi | 21 +- ..._code_interpreter_call_code_done_event.rbi | 21 +- ..._code_interpreter_call_completed_event.rbi | 26 +- ...ode_interpreter_call_in_progress_event.rbi | 26 +- ...de_interpreter_call_interpreting_event.rbi | 26 +- .../response_code_interpreter_tool_call.rbi | 100 +--- .../responses/response_completed_event.rbi | 18 +- .../responses/response_computer_tool_call.rbi | 280 ++-------- ...esponse_computer_tool_call_output_item.rbi | 80 +-- ...e_computer_tool_call_output_screenshot.rbi | 23 +- .../response_content_part_added_event.rbi | 42 +- .../response_content_part_done_event.rbi | 42 +- .../responses/response_create_params.rbi | 201 +------ .../responses/response_created_event.rbi | 18 +- .../models/responses/response_error.rbi | 17 +- .../models/responses/response_error_event.rbi | 28 +- .../responses/response_failed_event.rbi | 18 +- ...ponse_file_search_call_completed_event.rbi | 21 +- ...nse_file_search_call_in_progress_event.rbi | 21 +- ...ponse_file_search_call_searching_event.rbi | 21 +- .../response_file_search_tool_call.rbi | 83 +-- ...esponse_format_text_json_schema_config.rbi | 37 +- ...se_function_call_arguments_delta_event.rbi | 28 +- ...nse_function_call_arguments_done_event.rbi | 28 +- .../responses/response_function_tool_call.rbi | 47 +- .../response_function_tool_call_item.rbi | 7 +- ...esponse_function_tool_call_output_item.rbi | 39 +- .../response_function_web_search.rbi | 24 +- .../responses/response_in_progress_event.rbi | 18 +- .../responses/response_incomplete_event.rbi | 18 +- .../models/responses/response_input_audio.rbi | 24 +- .../models/responses/response_input_file.rbi | 31 +- .../models/responses/response_input_image.rbi | 31 +- .../models/responses/response_input_item.rbi | 193 ++----- .../responses/response_input_message_item.rbi | 65 +-- .../models/responses/response_input_text.rbi | 14 +- .../models/responses/response_item_list.rbi | 64 +-- .../responses/response_output_audio.rbi | 21 +- .../response_output_item_added_event.rbi | 42 +- .../response_output_item_done_event.rbi | 42 +- .../responses/response_output_message.rbi | 45 +- .../responses/response_output_refusal.rbi | 14 +- .../models/responses/response_output_text.rbi | 117 +--- .../responses/response_reasoning_item.rbi | 49 +- .../response_refusal_delta_event.rbi | 35 +- .../responses/response_refusal_done_event.rbi | 35 +- .../responses/response_retrieve_params.rbi | 11 +- .../response_text_annotation_delta_event.rbi | 134 +---- .../models/responses/response_text_config.rbi | 17 +- .../responses/response_text_delta_event.rbi | 35 +- .../responses/response_text_done_event.rbi | 35 +- .../models/responses/response_usage.rbi | 59 +- ...sponse_web_search_call_completed_event.rbi | 21 +- ...onse_web_search_call_in_progress_event.rbi | 21 +- ...sponse_web_search_call_searching_event.rbi | 21 +- .../models/responses/tool_choice_function.rbi | 14 +- .../models/responses/tool_choice_types.rbi | 10 +- .../models/responses/web_search_tool.rbi | 72 +-- .../models/static_file_chunking_strategy.rbi | 14 +- .../static_file_chunking_strategy_object.rbi | 18 +- ...ic_file_chunking_strategy_object_param.rbi | 18 +- rbi/lib/openai/models/upload.rbi | 70 +-- .../openai/models/upload_complete_params.rbi | 15 +- .../openai/models/upload_create_params.rbi | 28 +- .../models/uploads/part_create_params.rbi | 7 +- rbi/lib/openai/models/uploads/upload_part.rbi | 28 +- rbi/lib/openai/models/vector_store.rbi | 137 +---- .../models/vector_store_create_params.rbi | 63 +-- .../openai/models/vector_store_deleted.rbi | 21 +- .../models/vector_store_list_params.rbi | 35 +- .../models/vector_store_search_params.rbi | 66 +-- .../models/vector_store_search_response.rbi | 58 +- .../models/vector_store_update_params.rbi | 40 +- .../file_batch_cancel_params.rbi | 7 +- .../file_batch_create_params.rbi | 33 +- .../file_batch_list_files_params.rbi | 53 +- .../file_batch_retrieve_params.rbi | 7 +- .../vector_stores/file_content_params.rbi | 7 +- .../vector_stores/file_content_response.rbi | 16 +- .../vector_stores/file_create_params.rbi | 33 +- .../vector_stores/file_delete_params.rbi | 7 +- .../models/vector_stores/file_list_params.rbi | 46 +- .../vector_stores/file_retrieve_params.rbi | 7 +- .../vector_stores/file_update_params.rbi | 17 +- .../vector_stores/vector_store_file.rbi | 98 +--- .../vector_stores/vector_store_file_batch.rbi | 85 +-- .../vector_store_file_deleted.rbi | 21 +- rbi/lib/openai/page.rbi | 14 +- rbi/lib/openai/request_options.rbi | 58 +- rbi/lib/openai/resources/audio.rbi | 9 +- rbi/lib/openai/resources/beta.rbi | 6 +- rbi/lib/openai/resources/beta/threads.rbi | 6 +- .../openai/resources/beta/threads/runs.rbi | 3 +- rbi/lib/openai/resources/chat.rbi | 3 +- rbi/lib/openai/resources/chat/completions.rbi | 3 +- rbi/lib/openai/resources/fine_tuning.rbi | 3 +- rbi/lib/openai/resources/fine_tuning/jobs.rbi | 3 +- rbi/lib/openai/resources/responses.rbi | 3 +- rbi/lib/openai/resources/uploads.rbi | 3 +- rbi/lib/openai/resources/vector_stores.rbi | 6 +- 274 files changed, 2972 insertions(+), 11549 deletions(-) diff --git a/rbi/lib/openai/base_client.rbi b/rbi/lib/openai/base_client.rbi index 56d1eb77..92d2484d 100644 --- a/rbi/lib/openai/base_client.rbi +++ b/rbi/lib/openai/base_client.rbi @@ -83,13 +83,9 @@ module OpenAI end end + # @api private sig { returns(T.anything) } - def requester - end - - sig { params(_: T.anything).returns(T.anything) } - def requester=(_) - end + attr_accessor :requester # @api private sig do diff --git a/rbi/lib/openai/client.rbi b/rbi/lib/openai/client.rbi index 2d8c31bf..556aaeec 100644 --- a/rbi/lib/openai/client.rbi +++ b/rbi/lib/openai/client.rbi @@ -11,72 +11,55 @@ module OpenAI DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float) sig { returns(String) } - def api_key - end + attr_reader :api_key sig { returns(T.nilable(String)) } - def organization - end + attr_reader :organization sig { returns(T.nilable(String)) } - def project - end + attr_reader :project sig { returns(OpenAI::Resources::Completions) } - def completions - end + attr_reader :completions sig { returns(OpenAI::Resources::Chat) } - def chat - end + attr_reader :chat sig { returns(OpenAI::Resources::Embeddings) } - def embeddings - end + attr_reader :embeddings sig { returns(OpenAI::Resources::Files) } - def files - end + attr_reader :files sig { returns(OpenAI::Resources::Images) } - def images - end + attr_reader :images sig { returns(OpenAI::Resources::Audio) } - def audio - end + attr_reader :audio sig { returns(OpenAI::Resources::Moderations) } - def moderations - end + attr_reader :moderations sig { returns(OpenAI::Resources::Models) } - def models - end + attr_reader :models sig { returns(OpenAI::Resources::FineTuning) } - def fine_tuning - end + attr_reader :fine_tuning sig { returns(OpenAI::Resources::VectorStores) } - def vector_stores - end + attr_reader :vector_stores sig { returns(OpenAI::Resources::Beta) } - def beta - end + attr_reader :beta sig { returns(OpenAI::Resources::Batches) } - def batches - end + attr_reader :batches sig { returns(OpenAI::Resources::Uploads) } - def uploads - end + attr_reader :uploads sig { returns(OpenAI::Resources::Responses) } - def responses - end + attr_reader :responses # @api private sig { override.returns(T::Hash[String, String]) } diff --git a/rbi/lib/openai/cursor_page.rbi b/rbi/lib/openai/cursor_page.rbi index 261ed7d6..126a899e 100644 --- a/rbi/lib/openai/cursor_page.rbi +++ b/rbi/lib/openai/cursor_page.rbi @@ -7,20 +7,10 @@ module OpenAI Elem = type_member sig { returns(T.nilable(T::Array[Elem])) } - def data - end - - sig { params(_: T.nilable(T::Array[Elem])).returns(T.nilable(T::Array[Elem])) } - def data=(_) - end + attr_accessor :data sig { returns(T::Boolean) } - def has_more - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def has_more=(_) - end + attr_accessor :has_more sig { returns(String) } def inspect diff --git a/rbi/lib/openai/errors.rbi b/rbi/lib/openai/errors.rbi index 56d79f0b..e010e283 100644 --- a/rbi/lib/openai/errors.rbi +++ b/rbi/lib/openai/errors.rbi @@ -3,12 +3,7 @@ module OpenAI class Error < StandardError sig { returns(T.nilable(StandardError)) } - def cause - end - - sig { params(_: T.nilable(StandardError)).returns(T.nilable(StandardError)) } - def cause=(_) - end + attr_accessor :cause end class ConversionError < OpenAI::Error @@ -16,52 +11,22 @@ module OpenAI class APIError < OpenAI::Error sig { returns(URI::Generic) } - def url - end - - sig { params(_: URI::Generic).returns(URI::Generic) } - def url=(_) - end + attr_accessor :url sig { returns(T.nilable(Integer)) } - def status - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def status=(_) - end + attr_accessor :status sig { returns(T.nilable(T.anything)) } - def body - end - - sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } - def body=(_) - end + attr_accessor :body sig { returns(T.nilable(String)) } - def code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def code=(_) - end + attr_accessor :code sig { returns(T.nilable(String)) } - def param - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def param=(_) - end + attr_accessor :param sig { returns(T.nilable(String)) } - def type - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def type=(_) - end + attr_accessor :type # @api private sig do @@ -81,44 +46,19 @@ module OpenAI class APIConnectionError < OpenAI::APIError sig { void } - def status - end - - sig { params(_: NilClass).void } - def status=(_) - end + attr_accessor :status sig { void } - def body - end - - sig { params(_: NilClass).void } - def body=(_) - end + attr_accessor :body sig { void } - def code - end - - sig { params(_: NilClass).void } - def code=(_) - end + attr_accessor :code sig { void } - def param - end - - sig { params(_: NilClass).void } - def param=(_) - end + attr_accessor :param sig { void } - def type - end - - sig { params(_: NilClass).void } - def type=(_) - end + attr_accessor :type # @api private sig do @@ -170,36 +110,16 @@ module OpenAI end sig { returns(Integer) } - def status - end - - sig { params(_: Integer).returns(Integer) } - def status=(_) - end + attr_accessor :status sig { returns(T.nilable(String)) } - def code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def code=(_) - end + attr_accessor :code sig { returns(T.nilable(String)) } - def param - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def param=(_) - end + attr_accessor :param sig { returns(T.nilable(String)) } - def type - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def type=(_) - end + attr_accessor :type # @api private sig do diff --git a/rbi/lib/openai/models/audio/speech_create_params.rbi b/rbi/lib/openai/models/audio/speech_create_params.rbi index 0e0c0f1e..5c59d0c7 100644 --- a/rbi/lib/openai/models/audio/speech_create_params.rbi +++ b/rbi/lib/openai/models/audio/speech_create_params.rbi @@ -9,73 +9,43 @@ module OpenAI # The text to generate audio for. The maximum length is 4096 characters. sig { returns(String) } - def input - end - - sig { params(_: String).returns(String) } - def input=(_) - end + attr_accessor :input # One of the available [TTS models](https://platform.openai.com/docs/models#tts): # `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. sig { returns(T.any(String, OpenAI::Models::Audio::SpeechModel::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::Audio::SpeechModel::OrSymbol)) - .returns(T.any(String, OpenAI::Models::Audio::SpeechModel::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # The voice to use when generating the audio. Supported voices are `alloy`, `ash`, # `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the # voices are available in the # [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). sig { returns(OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol) } - def voice - end - - sig do - params(_: OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol) - .returns(OpenAI::Models::Audio::SpeechCreateParams::Voice::OrSymbol) - end - def voice=(_) - end + attr_accessor :voice # Control the voice of your generated audio with additional instructions. Does not # work with `tts-1` or `tts-1-hd`. sig { returns(T.nilable(String)) } - def instructions - end + attr_reader :instructions - sig { params(_: String).returns(String) } - def instructions=(_) - end + sig { params(instructions: String).void } + attr_writer :instructions # The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, # `wav`, and `pcm`. sig { returns(T.nilable(OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol)) } - def response_format - end + attr_reader :response_format - sig do - params(_: OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol) - .returns(OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol) - end - def response_format=(_) - end + sig { params(response_format: OpenAI::Models::Audio::SpeechCreateParams::ResponseFormat::OrSymbol).void } + attr_writer :response_format # The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is # the default. sig { returns(T.nilable(Float)) } - def speed - end + attr_reader :speed - sig { params(_: Float).returns(Float) } - def speed=(_) - end + sig { params(speed: Float).void } + attr_writer :speed sig do params( diff --git a/rbi/lib/openai/models/audio/transcription.rbi b/rbi/lib/openai/models/audio/transcription.rbi index bc60292b..92154d33 100644 --- a/rbi/lib/openai/models/audio/transcription.rbi +++ b/rbi/lib/openai/models/audio/transcription.rbi @@ -6,26 +6,19 @@ module OpenAI class Transcription < OpenAI::BaseModel # The transcribed text. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # The log probabilities of the tokens in the transcription. Only returned with the # models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added # to the `include` array. sig { returns(T.nilable(T::Array[OpenAI::Models::Audio::Transcription::Logprob])) } - def logprobs - end + attr_reader :logprobs sig do - params(_: T::Array[T.any(OpenAI::Models::Audio::Transcription::Logprob, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Audio::Transcription::Logprob, OpenAI::Util::AnyHash)]) - end - def logprobs=(_) + params(logprobs: T::Array[T.any(OpenAI::Models::Audio::Transcription::Logprob, OpenAI::Util::AnyHash)]) + .void end + attr_writer :logprobs # Represents a transcription response returned by model, based on the provided # input. @@ -46,30 +39,24 @@ module OpenAI class Logprob < OpenAI::BaseModel # The token in the transcription. sig { returns(T.nilable(String)) } - def token - end + attr_reader :token - sig { params(_: String).returns(String) } - def token=(_) - end + sig { params(token: String).void } + attr_writer :token # The bytes of the token. sig { returns(T.nilable(T::Array[Float])) } - def bytes - end + attr_reader :bytes - sig { params(_: T::Array[Float]).returns(T::Array[Float]) } - def bytes=(_) - end + sig { params(bytes: T::Array[Float]).void } + attr_writer :bytes # The log probability of the token. sig { returns(T.nilable(Float)) } - def logprob - end + attr_reader :logprob - sig { params(_: Float).returns(Float) } - def logprob=(_) - end + sig { params(logprob: Float).void } + attr_writer :logprob sig { params(token: String, bytes: T::Array[Float], logprob: Float).returns(T.attached_class) } def self.new(token: nil, bytes: nil, logprob: nil) diff --git a/rbi/lib/openai/models/audio/transcription_create_params.rbi b/rbi/lib/openai/models/audio/transcription_create_params.rbi index 21e8d1ad..93b5c317 100644 --- a/rbi/lib/openai/models/audio/transcription_create_params.rbi +++ b/rbi/lib/openai/models/audio/transcription_create_params.rbi @@ -10,26 +10,13 @@ module OpenAI # The audio file object (not file name) to transcribe, in one of these formats: # flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. sig { returns(T.any(IO, StringIO)) } - def file - end - - sig { params(_: T.any(IO, StringIO)).returns(T.any(IO, StringIO)) } - def file=(_) - end + attr_accessor :file # ID of the model to use. The options are `gpt-4o-transcribe`, # `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source # Whisper V2 model). sig { returns(T.any(String, OpenAI::Models::AudioModel::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::AudioModel::OrSymbol)) - .returns(T.any(String, OpenAI::Models::AudioModel::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # Additional information to include in the transcription response. `logprobs` will # return the log probabilities of the tokens in the response to understand the @@ -37,52 +24,38 @@ module OpenAI # response_format set to `json` and only with the models `gpt-4o-transcribe` and # `gpt-4o-mini-transcribe`. sig { returns(T.nilable(T::Array[OpenAI::Models::Audio::TranscriptionInclude::OrSymbol])) } - def include - end + attr_reader :include - sig do - params(_: T::Array[OpenAI::Models::Audio::TranscriptionInclude::OrSymbol]) - .returns(T::Array[OpenAI::Models::Audio::TranscriptionInclude::OrSymbol]) - end - def include=(_) - end + sig { params(include: T::Array[OpenAI::Models::Audio::TranscriptionInclude::OrSymbol]).void } + attr_writer :include # The language of the input audio. Supplying the input language in # [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) # format will improve accuracy and latency. sig { returns(T.nilable(String)) } - def language - end + attr_reader :language - sig { params(_: String).returns(String) } - def language=(_) - end + sig { params(language: String).void } + attr_writer :language # An optional text to guide the model's style or continue a previous audio # segment. The # [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) # should match the audio language. sig { returns(T.nilable(String)) } - def prompt - end + attr_reader :prompt - sig { params(_: String).returns(String) } - def prompt=(_) - end + sig { params(prompt: String).void } + attr_writer :prompt # The format of the output, in one of these options: `json`, `text`, `srt`, # `verbose_json`, or `vtt`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, # the only supported format is `json`. sig { returns(T.nilable(OpenAI::Models::AudioResponseFormat::OrSymbol)) } - def response_format - end + attr_reader :response_format - sig do - params(_: OpenAI::Models::AudioResponseFormat::OrSymbol) - .returns(OpenAI::Models::AudioResponseFormat::OrSymbol) - end - def response_format=(_) - end + sig { params(response_format: OpenAI::Models::AudioResponseFormat::OrSymbol).void } + attr_writer :response_format # The sampling temperature, between 0 and 1. Higher values like 0.8 will make the # output more random, while lower values like 0.2 will make it more focused and @@ -90,12 +63,10 @@ module OpenAI # [log probability](https://en.wikipedia.org/wiki/Log_probability) to # automatically increase the temperature until certain thresholds are hit. sig { returns(T.nilable(Float)) } - def temperature - end + attr_reader :temperature - sig { params(_: Float).returns(Float) } - def temperature=(_) - end + sig { params(temperature: Float).void } + attr_writer :temperature # The timestamp granularities to populate for this transcription. # `response_format` must be set `verbose_json` to use timestamp granularities. @@ -107,15 +78,15 @@ module OpenAI T.nilable(T::Array[OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity::OrSymbol]) ) end - def timestamp_granularities - end + attr_reader :timestamp_granularities sig do - params(_: T::Array[OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity::OrSymbol]) - .returns(T::Array[OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity::OrSymbol]) - end - def timestamp_granularities=(_) + params( + timestamp_granularities: T::Array[OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity::OrSymbol] + ) + .void end + attr_writer :timestamp_granularities sig do params( diff --git a/rbi/lib/openai/models/audio/transcription_segment.rbi b/rbi/lib/openai/models/audio/transcription_segment.rbi index 92a534a2..8bc3e5b2 100644 --- a/rbi/lib/openai/models/audio/transcription_segment.rbi +++ b/rbi/lib/openai/models/audio/transcription_segment.rbi @@ -6,96 +6,46 @@ module OpenAI class TranscriptionSegment < OpenAI::BaseModel # Unique identifier of the segment. sig { returns(Integer) } - def id - end - - sig { params(_: Integer).returns(Integer) } - def id=(_) - end + attr_accessor :id # Average logprob of the segment. If the value is lower than -1, consider the # logprobs failed. sig { returns(Float) } - def avg_logprob - end - - sig { params(_: Float).returns(Float) } - def avg_logprob=(_) - end + attr_accessor :avg_logprob # Compression ratio of the segment. If the value is greater than 2.4, consider the # compression failed. sig { returns(Float) } - def compression_ratio - end - - sig { params(_: Float).returns(Float) } - def compression_ratio=(_) - end + attr_accessor :compression_ratio # End time of the segment in seconds. sig { returns(Float) } - def end_ - end - - sig { params(_: Float).returns(Float) } - def end_=(_) - end + attr_accessor :end_ # Probability of no speech in the segment. If the value is higher than 1.0 and the # `avg_logprob` is below -1, consider this segment silent. sig { returns(Float) } - def no_speech_prob - end - - sig { params(_: Float).returns(Float) } - def no_speech_prob=(_) - end + attr_accessor :no_speech_prob # Seek offset of the segment. sig { returns(Integer) } - def seek - end - - sig { params(_: Integer).returns(Integer) } - def seek=(_) - end + attr_accessor :seek # Start time of the segment in seconds. sig { returns(Float) } - def start - end - - sig { params(_: Float).returns(Float) } - def start=(_) - end + attr_accessor :start # Temperature parameter used for generating the segment. sig { returns(Float) } - def temperature - end - - sig { params(_: Float).returns(Float) } - def temperature=(_) - end + attr_accessor :temperature # Text content of the segment. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # Array of token IDs for the text content. sig { returns(T::Array[Integer]) } - def tokens - end - - sig { params(_: T::Array[Integer]).returns(T::Array[Integer]) } - def tokens=(_) - end + attr_accessor :tokens sig do params( diff --git a/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi b/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi index 0f931bf2..0e61bfb0 100644 --- a/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi +++ b/rbi/lib/openai/models/audio/transcription_text_delta_event.rbi @@ -6,39 +6,25 @@ module OpenAI class TranscriptionTextDeltaEvent < OpenAI::BaseModel # The text delta that was additionally transcribed. sig { returns(String) } - def delta - end - - sig { params(_: String).returns(String) } - def delta=(_) - end + attr_accessor :delta # The type of the event. Always `transcript.text.delta`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The log probabilities of the delta. Only included if you # [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) # with the `include[]` parameter set to `logprobs`. sig { returns(T.nilable(T::Array[OpenAI::Models::Audio::TranscriptionTextDeltaEvent::Logprob])) } - def logprobs - end + attr_reader :logprobs sig do params( - _: T::Array[T.any(OpenAI::Models::Audio::TranscriptionTextDeltaEvent::Logprob, OpenAI::Util::AnyHash)] + logprobs: T::Array[T.any(OpenAI::Models::Audio::TranscriptionTextDeltaEvent::Logprob, OpenAI::Util::AnyHash)] ) - .returns( - T::Array[T.any(OpenAI::Models::Audio::TranscriptionTextDeltaEvent::Logprob, OpenAI::Util::AnyHash)] - ) - end - def logprobs=(_) + .void end + attr_writer :logprobs # Emitted when there is an additional text delta. This is also the first event # emitted when the transcription starts. Only emitted when you @@ -67,30 +53,24 @@ module OpenAI class Logprob < OpenAI::BaseModel # The token that was used to generate the log probability. sig { returns(T.nilable(String)) } - def token - end + attr_reader :token - sig { params(_: String).returns(String) } - def token=(_) - end + sig { params(token: String).void } + attr_writer :token # The bytes that were used to generate the log probability. sig { returns(T.nilable(T::Array[T.anything])) } - def bytes - end + attr_reader :bytes - sig { params(_: T::Array[T.anything]).returns(T::Array[T.anything]) } - def bytes=(_) - end + sig { params(bytes: T::Array[T.anything]).void } + attr_writer :bytes # The log probability of the token. sig { returns(T.nilable(Float)) } - def logprob - end + attr_reader :logprob - sig { params(_: Float).returns(Float) } - def logprob=(_) - end + sig { params(logprob: Float).void } + attr_writer :logprob sig { params(token: String, bytes: T::Array[T.anything], logprob: Float).returns(T.attached_class) } def self.new(token: nil, bytes: nil, logprob: nil) diff --git a/rbi/lib/openai/models/audio/transcription_text_done_event.rbi b/rbi/lib/openai/models/audio/transcription_text_done_event.rbi index 044cbf7c..ecfd6f55 100644 --- a/rbi/lib/openai/models/audio/transcription_text_done_event.rbi +++ b/rbi/lib/openai/models/audio/transcription_text_done_event.rbi @@ -6,40 +6,26 @@ module OpenAI class TranscriptionTextDoneEvent < OpenAI::BaseModel # The text that was transcribed. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # The type of the event. Always `transcript.text.done`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The log probabilities of the individual tokens in the transcription. Only # included if you # [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) # with the `include[]` parameter set to `logprobs`. sig { returns(T.nilable(T::Array[OpenAI::Models::Audio::TranscriptionTextDoneEvent::Logprob])) } - def logprobs - end + attr_reader :logprobs sig do params( - _: T::Array[T.any(OpenAI::Models::Audio::TranscriptionTextDoneEvent::Logprob, OpenAI::Util::AnyHash)] + logprobs: T::Array[T.any(OpenAI::Models::Audio::TranscriptionTextDoneEvent::Logprob, OpenAI::Util::AnyHash)] ) - .returns( - T::Array[T.any(OpenAI::Models::Audio::TranscriptionTextDoneEvent::Logprob, OpenAI::Util::AnyHash)] - ) - end - def logprobs=(_) + .void end + attr_writer :logprobs # Emitted when the transcription is complete. Contains the complete transcription # text. Only emitted when you @@ -68,30 +54,24 @@ module OpenAI class Logprob < OpenAI::BaseModel # The token that was used to generate the log probability. sig { returns(T.nilable(String)) } - def token - end + attr_reader :token - sig { params(_: String).returns(String) } - def token=(_) - end + sig { params(token: String).void } + attr_writer :token # The bytes that were used to generate the log probability. sig { returns(T.nilable(T::Array[T.anything])) } - def bytes - end + attr_reader :bytes - sig { params(_: T::Array[T.anything]).returns(T::Array[T.anything]) } - def bytes=(_) - end + sig { params(bytes: T::Array[T.anything]).void } + attr_writer :bytes # The log probability of the token. sig { returns(T.nilable(Float)) } - def logprob - end + attr_reader :logprob - sig { params(_: Float).returns(Float) } - def logprob=(_) - end + sig { params(logprob: Float).void } + attr_writer :logprob sig { params(token: String, bytes: T::Array[T.anything], logprob: Float).returns(T.attached_class) } def self.new(token: nil, bytes: nil, logprob: nil) diff --git a/rbi/lib/openai/models/audio/transcription_verbose.rbi b/rbi/lib/openai/models/audio/transcription_verbose.rbi index aba3ac2a..004b1ec3 100644 --- a/rbi/lib/openai/models/audio/transcription_verbose.rbi +++ b/rbi/lib/openai/models/audio/transcription_verbose.rbi @@ -6,54 +6,29 @@ module OpenAI class TranscriptionVerbose < OpenAI::BaseModel # The duration of the input audio. sig { returns(Float) } - def duration - end - - sig { params(_: Float).returns(Float) } - def duration=(_) - end + attr_accessor :duration # The language of the input audio. sig { returns(String) } - def language - end - - sig { params(_: String).returns(String) } - def language=(_) - end + attr_accessor :language # The transcribed text. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # Segments of the transcribed text and their corresponding details. sig { returns(T.nilable(T::Array[OpenAI::Models::Audio::TranscriptionSegment])) } - def segments - end + attr_reader :segments - sig do - params(_: T::Array[T.any(OpenAI::Models::Audio::TranscriptionSegment, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Audio::TranscriptionSegment, OpenAI::Util::AnyHash)]) - end - def segments=(_) - end + sig { params(segments: T::Array[T.any(OpenAI::Models::Audio::TranscriptionSegment, OpenAI::Util::AnyHash)]).void } + attr_writer :segments # Extracted words and their corresponding timestamps. sig { returns(T.nilable(T::Array[OpenAI::Models::Audio::TranscriptionWord])) } - def words - end + attr_reader :words - sig do - params(_: T::Array[T.any(OpenAI::Models::Audio::TranscriptionWord, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Audio::TranscriptionWord, OpenAI::Util::AnyHash)]) - end - def words=(_) - end + sig { params(words: T::Array[T.any(OpenAI::Models::Audio::TranscriptionWord, OpenAI::Util::AnyHash)]).void } + attr_writer :words # Represents a verbose json transcription response returned by model, based on the # provided input. diff --git a/rbi/lib/openai/models/audio/transcription_word.rbi b/rbi/lib/openai/models/audio/transcription_word.rbi index a3be4b46..c6adc3b1 100644 --- a/rbi/lib/openai/models/audio/transcription_word.rbi +++ b/rbi/lib/openai/models/audio/transcription_word.rbi @@ -6,30 +6,15 @@ module OpenAI class TranscriptionWord < OpenAI::BaseModel # End time of the word in seconds. sig { returns(Float) } - def end_ - end - - sig { params(_: Float).returns(Float) } - def end_=(_) - end + attr_accessor :end_ # Start time of the word in seconds. sig { returns(Float) } - def start - end - - sig { params(_: Float).returns(Float) } - def start=(_) - end + attr_accessor :start # The text content of the word. sig { returns(String) } - def word - end - - sig { params(_: String).returns(String) } - def word=(_) - end + attr_accessor :word sig { params(end_: Float, start: Float, word: String).returns(T.attached_class) } def self.new(end_:, start:, word:) diff --git a/rbi/lib/openai/models/audio/translation.rbi b/rbi/lib/openai/models/audio/translation.rbi index b9650fa4..07767362 100644 --- a/rbi/lib/openai/models/audio/translation.rbi +++ b/rbi/lib/openai/models/audio/translation.rbi @@ -5,12 +5,7 @@ module OpenAI module Audio class Translation < OpenAI::BaseModel sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text sig { params(text: String).returns(T.attached_class) } def self.new(text:) diff --git a/rbi/lib/openai/models/audio/translation_create_params.rbi b/rbi/lib/openai/models/audio/translation_create_params.rbi index 824eab32..6f8d3e8b 100644 --- a/rbi/lib/openai/models/audio/translation_create_params.rbi +++ b/rbi/lib/openai/models/audio/translation_create_params.rbi @@ -10,50 +10,30 @@ module OpenAI # The audio file object (not file name) translate, in one of these formats: flac, # mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. sig { returns(T.any(IO, StringIO)) } - def file - end - - sig { params(_: T.any(IO, StringIO)).returns(T.any(IO, StringIO)) } - def file=(_) - end + attr_accessor :file # ID of the model to use. Only `whisper-1` (which is powered by our open source # Whisper V2 model) is currently available. sig { returns(T.any(String, OpenAI::Models::AudioModel::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::AudioModel::OrSymbol)) - .returns(T.any(String, OpenAI::Models::AudioModel::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # An optional text to guide the model's style or continue a previous audio # segment. The # [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) # should be in English. sig { returns(T.nilable(String)) } - def prompt - end + attr_reader :prompt - sig { params(_: String).returns(String) } - def prompt=(_) - end + sig { params(prompt: String).void } + attr_writer :prompt # The format of the output, in one of these options: `json`, `text`, `srt`, # `verbose_json`, or `vtt`. sig { returns(T.nilable(OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat::OrSymbol)) } - def response_format - end + attr_reader :response_format - sig do - params(_: OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat::OrSymbol) - .returns(OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat::OrSymbol) - end - def response_format=(_) - end + sig { params(response_format: OpenAI::Models::Audio::TranslationCreateParams::ResponseFormat::OrSymbol).void } + attr_writer :response_format # The sampling temperature, between 0 and 1. Higher values like 0.8 will make the # output more random, while lower values like 0.2 will make it more focused and @@ -61,12 +41,10 @@ module OpenAI # [log probability](https://en.wikipedia.org/wiki/Log_probability) to # automatically increase the temperature until certain thresholds are hit. sig { returns(T.nilable(Float)) } - def temperature - end + attr_reader :temperature - sig { params(_: Float).returns(Float) } - def temperature=(_) - end + sig { params(temperature: Float).void } + attr_writer :temperature sig do params( diff --git a/rbi/lib/openai/models/audio/translation_verbose.rbi b/rbi/lib/openai/models/audio/translation_verbose.rbi index 8bceffaa..f12cba37 100644 --- a/rbi/lib/openai/models/audio/translation_verbose.rbi +++ b/rbi/lib/openai/models/audio/translation_verbose.rbi @@ -6,42 +6,22 @@ module OpenAI class TranslationVerbose < OpenAI::BaseModel # The duration of the input audio. sig { returns(Float) } - def duration - end - - sig { params(_: Float).returns(Float) } - def duration=(_) - end + attr_accessor :duration # The language of the output translation (always `english`). sig { returns(String) } - def language - end - - sig { params(_: String).returns(String) } - def language=(_) - end + attr_accessor :language # The translated text. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # Segments of the translated text and their corresponding details. sig { returns(T.nilable(T::Array[OpenAI::Models::Audio::TranscriptionSegment])) } - def segments - end + attr_reader :segments - sig do - params(_: T::Array[T.any(OpenAI::Models::Audio::TranscriptionSegment, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Audio::TranscriptionSegment, OpenAI::Util::AnyHash)]) - end - def segments=(_) - end + sig { params(segments: T::Array[T.any(OpenAI::Models::Audio::TranscriptionSegment, OpenAI::Util::AnyHash)]).void } + attr_writer :segments sig do params( diff --git a/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi b/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi index b1d97ad3..43d54634 100644 --- a/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi +++ b/rbi/lib/openai/models/auto_file_chunking_strategy_param.rbi @@ -5,12 +5,7 @@ module OpenAI class AutoFileChunkingStrategyParam < OpenAI::BaseModel # Always `auto`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. diff --git a/rbi/lib/openai/models/batch.rbi b/rbi/lib/openai/models/batch.rbi index c86180e1..c8c01aac 100644 --- a/rbi/lib/openai/models/batch.rbi +++ b/rbi/lib/openai/models/batch.rbi @@ -4,160 +4,100 @@ module OpenAI module Models class Batch < OpenAI::BaseModel sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The time frame within which the batch should be processed. sig { returns(String) } - def completion_window - end - - sig { params(_: String).returns(String) } - def completion_window=(_) - end + attr_accessor :completion_window # The Unix timestamp (in seconds) for when the batch was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The OpenAI API endpoint used by the batch. sig { returns(String) } - def endpoint - end - - sig { params(_: String).returns(String) } - def endpoint=(_) - end + attr_accessor :endpoint # The ID of the input file for the batch. sig { returns(String) } - def input_file_id - end - - sig { params(_: String).returns(String) } - def input_file_id=(_) - end + attr_accessor :input_file_id # The object type, which is always `batch`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The current status of the batch. sig { returns(OpenAI::Models::Batch::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Batch::Status::TaggedSymbol).returns(OpenAI::Models::Batch::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The Unix timestamp (in seconds) for when the batch was cancelled. sig { returns(T.nilable(Integer)) } - def cancelled_at - end + attr_reader :cancelled_at - sig { params(_: Integer).returns(Integer) } - def cancelled_at=(_) - end + sig { params(cancelled_at: Integer).void } + attr_writer :cancelled_at # The Unix timestamp (in seconds) for when the batch started cancelling. sig { returns(T.nilable(Integer)) } - def cancelling_at - end + attr_reader :cancelling_at - sig { params(_: Integer).returns(Integer) } - def cancelling_at=(_) - end + sig { params(cancelling_at: Integer).void } + attr_writer :cancelling_at # The Unix timestamp (in seconds) for when the batch was completed. sig { returns(T.nilable(Integer)) } - def completed_at - end + attr_reader :completed_at - sig { params(_: Integer).returns(Integer) } - def completed_at=(_) - end + sig { params(completed_at: Integer).void } + attr_writer :completed_at # The ID of the file containing the outputs of requests with errors. sig { returns(T.nilable(String)) } - def error_file_id - end + attr_reader :error_file_id - sig { params(_: String).returns(String) } - def error_file_id=(_) - end + sig { params(error_file_id: String).void } + attr_writer :error_file_id sig { returns(T.nilable(OpenAI::Models::Batch::Errors)) } - def errors - end + attr_reader :errors - sig do - params(_: T.any(OpenAI::Models::Batch::Errors, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Batch::Errors, OpenAI::Util::AnyHash)) - end - def errors=(_) - end + sig { params(errors: T.any(OpenAI::Models::Batch::Errors, OpenAI::Util::AnyHash)).void } + attr_writer :errors # The Unix timestamp (in seconds) for when the batch expired. sig { returns(T.nilable(Integer)) } - def expired_at - end + attr_reader :expired_at - sig { params(_: Integer).returns(Integer) } - def expired_at=(_) - end + sig { params(expired_at: Integer).void } + attr_writer :expired_at # The Unix timestamp (in seconds) for when the batch will expire. sig { returns(T.nilable(Integer)) } - def expires_at - end + attr_reader :expires_at - sig { params(_: Integer).returns(Integer) } - def expires_at=(_) - end + sig { params(expires_at: Integer).void } + attr_writer :expires_at # The Unix timestamp (in seconds) for when the batch failed. sig { returns(T.nilable(Integer)) } - def failed_at - end + attr_reader :failed_at - sig { params(_: Integer).returns(Integer) } - def failed_at=(_) - end + sig { params(failed_at: Integer).void } + attr_writer :failed_at # The Unix timestamp (in seconds) for when the batch started finalizing. sig { returns(T.nilable(Integer)) } - def finalizing_at - end + attr_reader :finalizing_at - sig { params(_: Integer).returns(Integer) } - def finalizing_at=(_) - end + sig { params(finalizing_at: Integer).void } + attr_writer :finalizing_at # The Unix timestamp (in seconds) for when the batch started processing. sig { returns(T.nilable(Integer)) } - def in_progress_at - end + attr_reader :in_progress_at - sig { params(_: Integer).returns(Integer) } - def in_progress_at=(_) - end + sig { params(in_progress_at: Integer).void } + attr_writer :in_progress_at # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -166,33 +106,21 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The ID of the file containing the outputs of successfully executed requests. sig { returns(T.nilable(String)) } - def output_file_id - end + attr_reader :output_file_id - sig { params(_: String).returns(String) } - def output_file_id=(_) - end + sig { params(output_file_id: String).void } + attr_writer :output_file_id # The request counts for different statuses within the batch. sig { returns(T.nilable(OpenAI::Models::BatchRequestCounts)) } - def request_counts - end + attr_reader :request_counts - sig do - params(_: T.any(OpenAI::Models::BatchRequestCounts, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::BatchRequestCounts, OpenAI::Util::AnyHash)) - end - def request_counts=(_) - end + sig { params(request_counts: T.any(OpenAI::Models::BatchRequestCounts, OpenAI::Util::AnyHash)).void } + attr_writer :request_counts sig do params( @@ -298,24 +226,17 @@ module OpenAI class Errors < OpenAI::BaseModel sig { returns(T.nilable(T::Array[OpenAI::Models::BatchError])) } - def data - end + attr_reader :data - sig do - params(_: T::Array[T.any(OpenAI::Models::BatchError, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::BatchError, OpenAI::Util::AnyHash)]) - end - def data=(_) - end + sig { params(data: T::Array[T.any(OpenAI::Models::BatchError, OpenAI::Util::AnyHash)]).void } + attr_writer :data # The object type, which is always `list`. sig { returns(T.nilable(String)) } - def object - end + attr_reader :object - sig { params(_: String).returns(String) } - def object=(_) - end + sig { params(object: String).void } + attr_writer :object sig do params(data: T::Array[T.any(OpenAI::Models::BatchError, OpenAI::Util::AnyHash)], object: String) diff --git a/rbi/lib/openai/models/batch_create_params.rbi b/rbi/lib/openai/models/batch_create_params.rbi index 46c3a392..25f982eb 100644 --- a/rbi/lib/openai/models/batch_create_params.rbi +++ b/rbi/lib/openai/models/batch_create_params.rbi @@ -9,30 +9,14 @@ module OpenAI # The time frame within which the batch should be processed. Currently only `24h` # is supported. sig { returns(OpenAI::Models::BatchCreateParams::CompletionWindow::OrSymbol) } - def completion_window - end - - sig do - params(_: OpenAI::Models::BatchCreateParams::CompletionWindow::OrSymbol) - .returns(OpenAI::Models::BatchCreateParams::CompletionWindow::OrSymbol) - end - def completion_window=(_) - end + attr_accessor :completion_window # The endpoint to be used for all requests in the batch. Currently # `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` # are supported. Note that `/v1/embeddings` batches are also restricted to a # maximum of 50,000 embedding inputs across all requests in the batch. sig { returns(OpenAI::Models::BatchCreateParams::Endpoint::OrSymbol) } - def endpoint - end - - sig do - params(_: OpenAI::Models::BatchCreateParams::Endpoint::OrSymbol) - .returns(OpenAI::Models::BatchCreateParams::Endpoint::OrSymbol) - end - def endpoint=(_) - end + attr_accessor :endpoint # The ID of an uploaded file that contains requests for the new batch. # @@ -44,12 +28,7 @@ module OpenAI # and must be uploaded with the purpose `batch`. The file can contain up to 50,000 # requests, and can be up to 200 MB in size. sig { returns(String) } - def input_file_id - end - - sig { params(_: String).returns(String) } - def input_file_id=(_) - end + attr_accessor :input_file_id # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -58,12 +37,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( diff --git a/rbi/lib/openai/models/batch_error.rbi b/rbi/lib/openai/models/batch_error.rbi index ded1e3bb..261a3ac1 100644 --- a/rbi/lib/openai/models/batch_error.rbi +++ b/rbi/lib/openai/models/batch_error.rbi @@ -5,39 +5,25 @@ module OpenAI class BatchError < OpenAI::BaseModel # An error code identifying the error type. sig { returns(T.nilable(String)) } - def code - end + attr_reader :code - sig { params(_: String).returns(String) } - def code=(_) - end + sig { params(code: String).void } + attr_writer :code # The line number of the input file where the error occurred, if applicable. sig { returns(T.nilable(Integer)) } - def line - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def line=(_) - end + attr_accessor :line # A human-readable message providing more details about the error. sig { returns(T.nilable(String)) } - def message - end + attr_reader :message - sig { params(_: String).returns(String) } - def message=(_) - end + sig { params(message: String).void } + attr_writer :message # The name of the parameter that caused the error, if applicable. sig { returns(T.nilable(String)) } - def param - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def param=(_) - end + attr_accessor :param sig do params(code: String, line: T.nilable(Integer), message: String, param: T.nilable(String)) diff --git a/rbi/lib/openai/models/batch_list_params.rbi b/rbi/lib/openai/models/batch_list_params.rbi index 460fe7ca..8fb64add 100644 --- a/rbi/lib/openai/models/batch_list_params.rbi +++ b/rbi/lib/openai/models/batch_list_params.rbi @@ -11,22 +11,18 @@ module OpenAI # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit sig do params( diff --git a/rbi/lib/openai/models/batch_request_counts.rbi b/rbi/lib/openai/models/batch_request_counts.rbi index df746c81..03b6cecc 100644 --- a/rbi/lib/openai/models/batch_request_counts.rbi +++ b/rbi/lib/openai/models/batch_request_counts.rbi @@ -5,30 +5,15 @@ module OpenAI class BatchRequestCounts < OpenAI::BaseModel # Number of requests that have been completed successfully. sig { returns(Integer) } - def completed - end - - sig { params(_: Integer).returns(Integer) } - def completed=(_) - end + attr_accessor :completed # Number of requests that have failed. sig { returns(Integer) } - def failed - end - - sig { params(_: Integer).returns(Integer) } - def failed=(_) - end + attr_accessor :failed # Total number of requests in the batch. sig { returns(Integer) } - def total - end - - sig { params(_: Integer).returns(Integer) } - def total=(_) - end + attr_accessor :total # The request counts for different statuses within the batch. sig { params(completed: Integer, failed: Integer, total: Integer).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/beta/assistant.rbi b/rbi/lib/openai/models/beta/assistant.rbi index 8dd6289e..e5fcf3bc 100644 --- a/rbi/lib/openai/models/beta/assistant.rbi +++ b/rbi/lib/openai/models/beta/assistant.rbi @@ -6,40 +6,20 @@ module OpenAI class Assistant < OpenAI::BaseModel # The identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the assistant was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The description of the assistant. The maximum length is 512 characters. sig { returns(T.nilable(String)) } - def description - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def description=(_) - end + attr_accessor :description # The system instructions that the assistant uses. The maximum length is 256,000 # characters. sig { returns(T.nilable(String)) } - def instructions - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def instructions=(_) - end + attr_accessor :instructions # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -48,12 +28,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # ID of the model to use. You can use the # [List models](https://platform.openai.com/docs/api-reference/models/list) API to @@ -61,30 +36,15 @@ module OpenAI # [Model overview](https://platform.openai.com/docs/models) for descriptions of # them. sig { returns(String) } - def model - end - - sig { params(_: String).returns(String) } - def model=(_) - end + attr_accessor :model # The name of the assistant. The maximum length is 256 characters. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name # The object type, which is always `assistant`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # A list of tool enabled on the assistant. There can be a maximum of 128 tools per # assistant. Tools can be of types `code_interpreter`, `file_search`, or @@ -100,31 +60,7 @@ module OpenAI ] ) end - def tools - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - end - def tools=(_) - end + attr_accessor :tools # Specifies the format that the model must output. Compatible with # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -158,59 +94,28 @@ module OpenAI ) ) end - def response_format - end - - sig do - params( - _: T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - .returns( - T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - end - def response_format=(_) - end + attr_accessor :response_format # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more # focused and deterministic. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # A set of resources that are used by the assistant's tools. The resources are # specific to the type of tool. For example, the `code_interpreter` tool requires # a list of file IDs, while the `file_search` tool requires a list of vector store # IDs. sig { returns(T.nilable(OpenAI::Models::Beta::Assistant::ToolResources)) } - def tool_resources - end + attr_reader :tool_resources sig do - params(_: T.nilable(T.any(OpenAI::Models::Beta::Assistant::ToolResources, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Assistant::ToolResources, OpenAI::Util::AnyHash))) - end - def tool_resources=(_) + params( + tool_resources: T.nilable(T.any(OpenAI::Models::Beta::Assistant::ToolResources, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :tool_resources # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -218,12 +123,7 @@ module OpenAI # # We generally recommend altering this or temperature but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p # Represents an `assistant` that can call the model and use tools. sig do @@ -314,26 +214,26 @@ module OpenAI class ToolResources < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::Beta::Assistant::ToolResources::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do - params(_: T.any(OpenAI::Models::Beta::Assistant::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Assistant::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash)) - end - def code_interpreter=(_) + params( + code_interpreter: T.any(OpenAI::Models::Beta::Assistant::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :code_interpreter sig { returns(T.nilable(OpenAI::Models::Beta::Assistant::ToolResources::FileSearch)) } - def file_search - end + attr_reader :file_search sig do - params(_: T.any(OpenAI::Models::Beta::Assistant::ToolResources::FileSearch, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Assistant::ToolResources::FileSearch, OpenAI::Util::AnyHash)) - end - def file_search=(_) + params( + file_search: T.any(OpenAI::Models::Beta::Assistant::ToolResources::FileSearch, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :file_search # A set of resources that are used by the assistant's tools. The resources are # specific to the type of tool. For example, the `code_interpreter` tool requires @@ -366,12 +266,10 @@ module OpenAI # available to the `code_interpreter`` tool. There can be a maximum of 20 files # associated with the tool. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } def self.new(file_ids: nil) @@ -388,12 +286,10 @@ module OpenAI # attached to this assistant. There can be a maximum of 1 vector store attached to # the assistant. sig { returns(T.nilable(T::Array[String])) } - def vector_store_ids - end + attr_reader :vector_store_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + sig { params(vector_store_ids: T::Array[String]).void } + attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } def self.new(vector_store_ids: nil) diff --git a/rbi/lib/openai/models/beta/assistant_create_params.rbi b/rbi/lib/openai/models/beta/assistant_create_params.rbi index 0251dc51..24382098 100644 --- a/rbi/lib/openai/models/beta/assistant_create_params.rbi +++ b/rbi/lib/openai/models/beta/assistant_create_params.rbi @@ -13,34 +13,16 @@ module OpenAI # [Model overview](https://platform.openai.com/docs/models) for descriptions of # them. sig { returns(T.any(String, OpenAI::Models::ChatModel::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::ChatModel::OrSymbol)) - .returns(T.any(String, OpenAI::Models::ChatModel::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # The description of the assistant. The maximum length is 512 characters. sig { returns(T.nilable(String)) } - def description - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def description=(_) - end + attr_accessor :description # The system instructions that the assistant uses. The maximum length is 256,000 # characters. sig { returns(T.nilable(String)) } - def instructions - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def instructions=(_) - end + attr_accessor :instructions # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -49,21 +31,11 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The name of the assistant. The maximum length is 256 characters. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name # **o-series models only** # @@ -72,15 +44,7 @@ module OpenAI # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can # result in faster responses and fewer tokens used on reasoning in a response. sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) } - def reasoning_effort - end - - sig do - params(_: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - end - def reasoning_effort=(_) - end + attr_accessor :reasoning_effort # Specifies the format that the model must output. Compatible with # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -114,63 +78,28 @@ module OpenAI ) ) end - def response_format - end - - sig do - params( - _: T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - .returns( - T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - end - def response_format=(_) - end + attr_accessor :response_format # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more # focused and deterministic. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # A set of resources that are used by the assistant's tools. The resources are # specific to the type of tool. For example, the `code_interpreter` tool requires # a list of file IDs, while the `file_search` tool requires a list of vector store # IDs. sig { returns(T.nilable(OpenAI::Models::Beta::AssistantCreateParams::ToolResources)) } - def tool_resources - end + attr_reader :tool_resources sig do params( - _: T.nilable(T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources, OpenAI::Util::AnyHash)) + tool_resources: T.nilable(T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources, OpenAI::Util::AnyHash)) ) - .returns( - T.nilable(T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources, OpenAI::Util::AnyHash)) - ) - end - def tool_resources=(_) + .void end + attr_writer :tool_resources # A list of tool enabled on the assistant. There can be a maximum of 128 tools per # assistant. Tools can be of types `code_interpreter`, `file_search`, or @@ -188,12 +117,11 @@ module OpenAI ) ) end - def tools - end + attr_reader :tools sig do params( - _: T::Array[ + tools: T::Array[ T.any( OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Util::AnyHash, @@ -202,19 +130,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - end - def tools=(_) + .void end + attr_writer :tools # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -222,12 +140,7 @@ module OpenAI # # We generally recommend altering this or temperature but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p sig do params( @@ -331,34 +244,26 @@ module OpenAI class ToolResources < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::Beta::AssistantCreateParams::ToolResources::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do params( - _: T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) + code_interpreter: T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) - ) - end - def code_interpreter=(_) + .void end + attr_writer :code_interpreter sig { returns(T.nilable(OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch)) } - def file_search - end + attr_reader :file_search sig do params( - _: T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) + file_search: T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) - ) - end - def file_search=(_) + .void end + attr_writer :file_search # A set of resources that are used by the assistant's tools. The resources are # specific to the type of tool. For example, the `code_interpreter` tool requires @@ -391,12 +296,10 @@ module OpenAI # available to the `code_interpreter` tool. There can be a maximum of 20 files # associated with the tool. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } def self.new(file_ids: nil) @@ -413,12 +316,10 @@ module OpenAI # attached to this assistant. There can be a maximum of 1 vector store attached to # the assistant. sig { returns(T.nilable(T::Array[String])) } - def vector_store_ids - end + attr_reader :vector_store_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + sig { params(vector_store_ids: T::Array[String]).void } + attr_writer :vector_store_ids # A helper to create a # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) @@ -429,29 +330,20 @@ module OpenAI T.nilable(T::Array[OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore]) ) end - def vector_stores - end + attr_reader :vector_stores sig do params( - _: T::Array[ + vector_stores: T::Array[ T.any( OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore, OpenAI::Util::AnyHash ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore, - OpenAI::Util::AnyHash - ) - ] - ) - end - def vector_stores=(_) + .void end + attr_writer :vector_stores sig do params( @@ -493,38 +385,28 @@ module OpenAI ) ) end - def chunking_strategy - end + attr_reader :chunking_strategy sig do params( - _: T.any( + chunking_strategy: T.any( OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Util::AnyHash, OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static ) ) - .returns( - T.any( - OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static - ) - ) - end - def chunking_strategy=(_) + .void end + attr_writer :chunking_strategy # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to # add to the vector store. There can be a maximum of 10000 files in a vector # store. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -533,14 +415,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig do - params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) - end - def metadata=(_) - end + attr_accessor :metadata sig do params( @@ -591,12 +466,7 @@ module OpenAI class Auto < OpenAI::BaseModel # Always `auto`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. @@ -615,34 +485,22 @@ module OpenAI OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static ) end - def static - end + attr_reader :static sig do params( - _: T.any( + static: T.any( OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static, - OpenAI::Util::AnyHash - ) - ) - end - def static=(_) + .void end + attr_writer :static # Always `static`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params( @@ -674,22 +532,12 @@ module OpenAI # # Note that the overlap must not exceed half of `max_chunk_size_tokens`. sig { returns(Integer) } - def chunk_overlap_tokens - end - - sig { params(_: Integer).returns(Integer) } - def chunk_overlap_tokens=(_) - end + attr_accessor :chunk_overlap_tokens # The maximum number of tokens in each chunk. The default value is `800`. The # minimum value is `100` and the maximum value is `4096`. sig { returns(Integer) } - def max_chunk_size_tokens - end - - sig { params(_: Integer).returns(Integer) } - def max_chunk_size_tokens=(_) - end + attr_accessor :max_chunk_size_tokens sig do params( diff --git a/rbi/lib/openai/models/beta/assistant_deleted.rbi b/rbi/lib/openai/models/beta/assistant_deleted.rbi index bf4cde08..c5b56819 100644 --- a/rbi/lib/openai/models/beta/assistant_deleted.rbi +++ b/rbi/lib/openai/models/beta/assistant_deleted.rbi @@ -5,28 +5,13 @@ module OpenAI module Beta class AssistantDeleted < OpenAI::BaseModel sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id sig { returns(T::Boolean) } - def deleted - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def deleted=(_) - end + attr_accessor :deleted sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } def self.new(id:, deleted:, object: :"assistant.deleted") diff --git a/rbi/lib/openai/models/beta/assistant_list_params.rbi b/rbi/lib/openai/models/beta/assistant_list_params.rbi index 76427298..845086ec 100644 --- a/rbi/lib/openai/models/beta/assistant_list_params.rbi +++ b/rbi/lib/openai/models/beta/assistant_list_params.rbi @@ -12,47 +12,36 @@ module OpenAI # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A cursor for use in pagination. `before` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # starting with obj_foo, your subsequent call can include before=obj_foo in order # to fetch the previous page of the list. sig { returns(T.nilable(String)) } - def before - end + attr_reader :before - sig { params(_: String).returns(String) } - def before=(_) - end + sig { params(before: String).void } + attr_writer :before # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order by the `created_at` timestamp of the objects. `asc` for ascending # order and `desc` for descending order. sig { returns(T.nilable(OpenAI::Models::Beta::AssistantListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::Beta::AssistantListParams::Order::OrSymbol) - .returns(OpenAI::Models::Beta::AssistantListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::Beta::AssistantListParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/beta/assistant_stream_event.rbi b/rbi/lib/openai/models/beta/assistant_stream_event.rbi index 449d6397..eb08519f 100644 --- a/rbi/lib/openai/models/beta/assistant_stream_event.rbi +++ b/rbi/lib/openai/models/beta/assistant_stream_event.rbi @@ -62,32 +62,20 @@ module OpenAI # Represents a thread that contains # [messages](https://platform.openai.com/docs/api-reference/messages). sig { returns(OpenAI::Models::Beta::Thread) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Thread, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Thread, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Thread, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Whether to enable input audio transcription. sig { returns(T.nilable(T::Boolean)) } - def enabled - end + attr_reader :enabled - sig { params(_: T::Boolean).returns(T::Boolean) } - def enabled=(_) - end + sig { params(enabled: T::Boolean).void } + attr_writer :enabled # Occurs when a new # [thread](https://platform.openai.com/docs/api-reference/threads/object) is @@ -112,23 +100,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a new # [run](https://platform.openai.com/docs/api-reference/runs/object) is created. @@ -148,23 +126,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `queued` status. @@ -184,23 +152,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to an `in_progress` status. @@ -220,23 +178,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `requires_action` status. @@ -256,23 +204,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # is completed. @@ -292,23 +230,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # ends with status `incomplete`. @@ -328,23 +256,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # fails. @@ -364,23 +282,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `cancelling` status. @@ -400,23 +308,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # is cancelled. @@ -436,23 +334,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # expires. @@ -471,23 +359,13 @@ module OpenAI class ThreadRunStepCreated < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -507,23 +385,13 @@ module OpenAI class ThreadRunStepInProgress < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -544,23 +412,13 @@ module OpenAI # Represents a run step delta i.e. any changed fields on a run step during # streaming. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when parts of a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -583,23 +441,13 @@ module OpenAI class ThreadRunStepCompleted < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -619,23 +467,13 @@ module OpenAI class ThreadRunStepFailed < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -655,23 +493,13 @@ module OpenAI class ThreadRunStepCancelled < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -691,23 +519,13 @@ module OpenAI class ThreadRunStepExpired < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -728,23 +546,13 @@ module OpenAI # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Message) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) is @@ -765,23 +573,13 @@ module OpenAI # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Message) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) moves @@ -802,23 +600,13 @@ module OpenAI # Represents a message delta i.e. any changed fields on a message during # streaming. sig { returns(OpenAI::Models::Beta::Threads::MessageDeltaEvent) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::MessageDeltaEvent, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::MessageDeltaEvent, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::MessageDeltaEvent, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when parts of a # [Message](https://platform.openai.com/docs/api-reference/messages/object) are @@ -842,23 +630,13 @@ module OpenAI # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Message) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) is @@ -879,23 +657,13 @@ module OpenAI # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Message) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) ends @@ -914,23 +682,13 @@ module OpenAI class ErrorEvent < OpenAI::BaseModel sig { returns(OpenAI::Models::ErrorObject) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::ErrorObject, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::ErrorObject, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::ErrorObject, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when an # [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs. diff --git a/rbi/lib/openai/models/beta/assistant_tool_choice.rbi b/rbi/lib/openai/models/beta/assistant_tool_choice.rbi index 1d11f89d..47eef189 100644 --- a/rbi/lib/openai/models/beta/assistant_tool_choice.rbi +++ b/rbi/lib/openai/models/beta/assistant_tool_choice.rbi @@ -6,26 +6,13 @@ module OpenAI class AssistantToolChoice < OpenAI::BaseModel # The type of the tool. If type is `function`, the function name must be set sig { returns(OpenAI::Models::Beta::AssistantToolChoice::Type::OrSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::Beta::AssistantToolChoice::Type::OrSymbol) - .returns(OpenAI::Models::Beta::AssistantToolChoice::Type::OrSymbol) - end - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(OpenAI::Models::Beta::AssistantToolChoiceFunction)) } - def function - end + attr_reader :function - sig do - params(_: T.any(OpenAI::Models::Beta::AssistantToolChoiceFunction, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::AssistantToolChoiceFunction, OpenAI::Util::AnyHash)) - end - def function=(_) - end + sig { params(function: T.any(OpenAI::Models::Beta::AssistantToolChoiceFunction, OpenAI::Util::AnyHash)).void } + attr_writer :function # Specifies a tool the model should use. Use to force the model to call a specific # tool. diff --git a/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi b/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi index 6e594ce1..084e57a8 100644 --- a/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi +++ b/rbi/lib/openai/models/beta/assistant_tool_choice_function.rbi @@ -6,12 +6,7 @@ module OpenAI class AssistantToolChoiceFunction < OpenAI::BaseModel # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name sig { params(name: String).returns(T.attached_class) } def self.new(name:) diff --git a/rbi/lib/openai/models/beta/assistant_update_params.rbi b/rbi/lib/openai/models/beta/assistant_update_params.rbi index b266b2e2..09cfa6aa 100644 --- a/rbi/lib/openai/models/beta/assistant_update_params.rbi +++ b/rbi/lib/openai/models/beta/assistant_update_params.rbi @@ -9,22 +9,12 @@ module OpenAI # The description of the assistant. The maximum length is 512 characters. sig { returns(T.nilable(String)) } - def description - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def description=(_) - end + attr_accessor :description # The system instructions that the assistant uses. The maximum length is 256,000 # characters. sig { returns(T.nilable(String)) } - def instructions - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def instructions=(_) - end + attr_accessor :instructions # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -33,12 +23,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # ID of the model to use. You can use the # [List models](https://platform.openai.com/docs/api-reference/models/list) API to @@ -46,24 +31,14 @@ module OpenAI # [Model overview](https://platform.openai.com/docs/models) for descriptions of # them. sig { returns(T.nilable(T.any(String, OpenAI::Models::Beta::AssistantUpdateParams::Model::OrSymbol))) } - def model - end + attr_reader :model - sig do - params(_: T.any(String, OpenAI::Models::Beta::AssistantUpdateParams::Model::OrSymbol)) - .returns(T.any(String, OpenAI::Models::Beta::AssistantUpdateParams::Model::OrSymbol)) - end - def model=(_) - end + sig { params(model: T.any(String, OpenAI::Models::Beta::AssistantUpdateParams::Model::OrSymbol)).void } + attr_writer :model # The name of the assistant. The maximum length is 256 characters. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name # **o-series models only** # @@ -72,15 +47,7 @@ module OpenAI # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can # result in faster responses and fewer tokens used on reasoning in a response. sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) } - def reasoning_effort - end - - sig do - params(_: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - end - def reasoning_effort=(_) - end + attr_accessor :reasoning_effort # Specifies the format that the model must output. Compatible with # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -114,63 +81,28 @@ module OpenAI ) ) end - def response_format - end - - sig do - params( - _: T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - .returns( - T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - end - def response_format=(_) - end + attr_accessor :response_format # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more # focused and deterministic. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # A set of resources that are used by the assistant's tools. The resources are # specific to the type of tool. For example, the `code_interpreter` tool requires # a list of file IDs, while the `file_search` tool requires a list of vector store # IDs. sig { returns(T.nilable(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources)) } - def tool_resources - end + attr_reader :tool_resources sig do params( - _: T.nilable(T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources, OpenAI::Util::AnyHash)) + tool_resources: T.nilable(T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources, OpenAI::Util::AnyHash)) ) - .returns( - T.nilable(T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources, OpenAI::Util::AnyHash)) - ) - end - def tool_resources=(_) + .void end + attr_writer :tool_resources # A list of tool enabled on the assistant. There can be a maximum of 128 tools per # assistant. Tools can be of types `code_interpreter`, `file_search`, or @@ -188,12 +120,11 @@ module OpenAI ) ) end - def tools - end + attr_reader :tools sig do params( - _: T::Array[ + tools: T::Array[ T.any( OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Util::AnyHash, @@ -202,19 +133,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - end - def tools=(_) + .void end + attr_writer :tools # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -222,12 +143,7 @@ module OpenAI # # We generally recommend altering this or temperature but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p sig do params( @@ -386,34 +302,26 @@ module OpenAI class ToolResources < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do params( - _: T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) + code_interpreter: T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) - ) - end - def code_interpreter=(_) + .void end + attr_writer :code_interpreter sig { returns(T.nilable(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::FileSearch)) } - def file_search - end + attr_reader :file_search sig do params( - _: T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) + file_search: T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) - ) - end - def file_search=(_) + .void end + attr_writer :file_search # A set of resources that are used by the assistant's tools. The resources are # specific to the type of tool. For example, the `code_interpreter` tool requires @@ -447,12 +355,10 @@ module OpenAI # to the `code_interpreter` tool. There can be a maximum of 20 files associated # with the tool. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } def self.new(file_ids: nil) @@ -469,12 +375,10 @@ module OpenAI # attached to this assistant. There can be a maximum of 1 vector store attached to # the assistant. sig { returns(T.nilable(T::Array[String])) } - def vector_store_ids - end + attr_reader :vector_store_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + sig { params(vector_store_ids: T::Array[String]).void } + attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } def self.new(vector_store_ids: nil) diff --git a/rbi/lib/openai/models/beta/code_interpreter_tool.rbi b/rbi/lib/openai/models/beta/code_interpreter_tool.rbi index ba0e9924..3e68afee 100644 --- a/rbi/lib/openai/models/beta/code_interpreter_tool.rbi +++ b/rbi/lib/openai/models/beta/code_interpreter_tool.rbi @@ -6,12 +6,7 @@ module OpenAI class CodeInterpreterTool < OpenAI::BaseModel # The type of tool being defined: `code_interpreter` sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } def self.new(type: :code_interpreter) diff --git a/rbi/lib/openai/models/beta/file_search_tool.rbi b/rbi/lib/openai/models/beta/file_search_tool.rbi index e44328a2..cc00d4a9 100644 --- a/rbi/lib/openai/models/beta/file_search_tool.rbi +++ b/rbi/lib/openai/models/beta/file_search_tool.rbi @@ -6,24 +6,14 @@ module OpenAI class FileSearchTool < OpenAI::BaseModel # The type of tool being defined: `file_search` sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Overrides for the file search tool. sig { returns(T.nilable(OpenAI::Models::Beta::FileSearchTool::FileSearch)) } - def file_search - end + attr_reader :file_search - sig do - params(_: T.any(OpenAI::Models::Beta::FileSearchTool::FileSearch, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::FileSearchTool::FileSearch, OpenAI::Util::AnyHash)) - end - def file_search=(_) - end + sig { params(file_search: T.any(OpenAI::Models::Beta::FileSearchTool::FileSearch, OpenAI::Util::AnyHash)).void } + attr_writer :file_search sig do params( @@ -49,12 +39,10 @@ module OpenAI # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) # for more information. sig { returns(T.nilable(Integer)) } - def max_num_results - end + attr_reader :max_num_results - sig { params(_: Integer).returns(Integer) } - def max_num_results=(_) - end + sig { params(max_num_results: Integer).void } + attr_writer :max_num_results # The ranking options for the file search. If not specified, the file search tool # will use the `auto` ranker and a score_threshold of 0. @@ -63,15 +51,15 @@ module OpenAI # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) # for more information. sig { returns(T.nilable(OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions)) } - def ranking_options - end + attr_reader :ranking_options sig do - params(_: T.any(OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions, OpenAI::Util::AnyHash)) - end - def ranking_options=(_) + params( + ranking_options: T.any(OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :ranking_options # Overrides for the file search tool. sig do @@ -97,25 +85,15 @@ module OpenAI # The score threshold for the file search. All values must be a floating point # number between 0 and 1. sig { returns(Float) } - def score_threshold - end - - sig { params(_: Float).returns(Float) } - def score_threshold=(_) - end + attr_accessor :score_threshold # The ranker to use for the file search. If not specified will use the `auto` # ranker. sig { returns(T.nilable(OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions::Ranker::OrSymbol)) } - def ranker - end + attr_reader :ranker - sig do - params(_: OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions::Ranker::OrSymbol) - .returns(OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions::Ranker::OrSymbol) - end - def ranker=(_) - end + sig { params(ranker: OpenAI::Models::Beta::FileSearchTool::FileSearch::RankingOptions::Ranker::OrSymbol).void } + attr_writer :ranker # The ranking options for the file search. If not specified, the file search tool # will use the `auto` ranker and a score_threshold of 0. diff --git a/rbi/lib/openai/models/beta/function_tool.rbi b/rbi/lib/openai/models/beta/function_tool.rbi index c69fa0dd..b12da233 100644 --- a/rbi/lib/openai/models/beta/function_tool.rbi +++ b/rbi/lib/openai/models/beta/function_tool.rbi @@ -5,24 +5,14 @@ module OpenAI module Beta class FunctionTool < OpenAI::BaseModel sig { returns(OpenAI::Models::FunctionDefinition) } - def function - end + attr_reader :function - sig do - params(_: T.any(OpenAI::Models::FunctionDefinition, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FunctionDefinition, OpenAI::Util::AnyHash)) - end - def function=(_) - end + sig { params(function: T.any(OpenAI::Models::FunctionDefinition, OpenAI::Util::AnyHash)).void } + attr_writer :function # The type of tool being defined: `function` sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params(function: T.any(OpenAI::Models::FunctionDefinition, OpenAI::Util::AnyHash), type: Symbol) diff --git a/rbi/lib/openai/models/beta/message_stream_event.rbi b/rbi/lib/openai/models/beta/message_stream_event.rbi index 8eb06277..6487db0b 100644 --- a/rbi/lib/openai/models/beta/message_stream_event.rbi +++ b/rbi/lib/openai/models/beta/message_stream_event.rbi @@ -26,23 +26,13 @@ module OpenAI # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Message) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) is @@ -63,23 +53,13 @@ module OpenAI # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Message) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) moves @@ -100,23 +80,13 @@ module OpenAI # Represents a message delta i.e. any changed fields on a message during # streaming. sig { returns(OpenAI::Models::Beta::Threads::MessageDeltaEvent) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::MessageDeltaEvent, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::MessageDeltaEvent, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::MessageDeltaEvent, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when parts of a # [Message](https://platform.openai.com/docs/api-reference/messages/object) are @@ -140,23 +110,13 @@ module OpenAI # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Message) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) is @@ -177,23 +137,13 @@ module OpenAI # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Message) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Message, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [message](https://platform.openai.com/docs/api-reference/messages/object) ends diff --git a/rbi/lib/openai/models/beta/run_step_stream_event.rbi b/rbi/lib/openai/models/beta/run_step_stream_event.rbi index 283216f5..f39da267 100644 --- a/rbi/lib/openai/models/beta/run_step_stream_event.rbi +++ b/rbi/lib/openai/models/beta/run_step_stream_event.rbi @@ -27,23 +27,13 @@ module OpenAI class ThreadRunStepCreated < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -63,23 +53,13 @@ module OpenAI class ThreadRunStepInProgress < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -100,23 +80,13 @@ module OpenAI # Represents a run step delta i.e. any changed fields on a run step during # streaming. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaEvent, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when parts of a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -139,23 +109,13 @@ module OpenAI class ThreadRunStepCompleted < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -175,23 +135,13 @@ module OpenAI class ThreadRunStepFailed < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -211,23 +161,13 @@ module OpenAI class ThreadRunStepCancelled < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) @@ -247,23 +187,13 @@ module OpenAI class ThreadRunStepExpired < OpenAI::BaseModel # Represents a step in execution of a run. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Runs::RunStep, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a # [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) diff --git a/rbi/lib/openai/models/beta/run_stream_event.rbi b/rbi/lib/openai/models/beta/run_stream_event.rbi index de3392b0..03f0c58b 100644 --- a/rbi/lib/openai/models/beta/run_stream_event.rbi +++ b/rbi/lib/openai/models/beta/run_stream_event.rbi @@ -30,23 +30,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a new # [run](https://platform.openai.com/docs/api-reference/runs/object) is created. @@ -66,23 +56,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `queued` status. @@ -102,23 +82,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to an `in_progress` status. @@ -138,23 +108,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `requires_action` status. @@ -174,23 +134,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # is completed. @@ -210,23 +160,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # ends with status `incomplete`. @@ -246,23 +186,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # fails. @@ -282,23 +212,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # moves to a `cancelling` status. @@ -318,23 +238,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # is cancelled. @@ -354,23 +264,13 @@ module OpenAI # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). sig { returns(OpenAI::Models::Beta::Threads::Run) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Threads::Run, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) # expires. diff --git a/rbi/lib/openai/models/beta/thread.rbi b/rbi/lib/openai/models/beta/thread.rbi index 3cd4db69..9061c27f 100644 --- a/rbi/lib/openai/models/beta/thread.rbi +++ b/rbi/lib/openai/models/beta/thread.rbi @@ -6,21 +6,11 @@ module OpenAI class Thread < OpenAI::BaseModel # The identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the thread was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -29,36 +19,26 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The object type, which is always `thread`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # A set of resources that are made available to the assistant's tools in this # thread. The resources are specific to the type of tool. For example, the # `code_interpreter` tool requires a list of file IDs, while the `file_search` # tool requires a list of vector store IDs. sig { returns(T.nilable(OpenAI::Models::Beta::Thread::ToolResources)) } - def tool_resources - end + attr_reader :tool_resources sig do - params(_: T.nilable(T.any(OpenAI::Models::Beta::Thread::ToolResources, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Thread::ToolResources, OpenAI::Util::AnyHash))) - end - def tool_resources=(_) + params( + tool_resources: T.nilable(T.any(OpenAI::Models::Beta::Thread::ToolResources, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :tool_resources # Represents a thread that contains # [messages](https://platform.openai.com/docs/api-reference/messages). @@ -92,26 +72,24 @@ module OpenAI class ToolResources < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::Beta::Thread::ToolResources::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do - params(_: T.any(OpenAI::Models::Beta::Thread::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Thread::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash)) - end - def code_interpreter=(_) + params( + code_interpreter: T.any(OpenAI::Models::Beta::Thread::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :code_interpreter sig { returns(T.nilable(OpenAI::Models::Beta::Thread::ToolResources::FileSearch)) } - def file_search - end + attr_reader :file_search sig do - params(_: T.any(OpenAI::Models::Beta::Thread::ToolResources::FileSearch, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Thread::ToolResources::FileSearch, OpenAI::Util::AnyHash)) - end - def file_search=(_) + params(file_search: T.any(OpenAI::Models::Beta::Thread::ToolResources::FileSearch, OpenAI::Util::AnyHash)) + .void end + attr_writer :file_search # A set of resources that are made available to the assistant's tools in this # thread. The resources are specific to the type of tool. For example, the @@ -144,12 +122,10 @@ module OpenAI # available to the `code_interpreter` tool. There can be a maximum of 20 files # associated with the tool. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } def self.new(file_ids: nil) @@ -166,12 +142,10 @@ module OpenAI # attached to this thread. There can be a maximum of 1 vector store attached to # the thread. sig { returns(T.nilable(T::Array[String])) } - def vector_store_ids - end + attr_reader :vector_store_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + sig { params(vector_store_ids: T::Array[String]).void } + attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } def self.new(vector_store_ids: nil) diff --git a/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi b/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi index b44e4bcf..ed08bc73 100644 --- a/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi +++ b/rbi/lib/openai/models/beta/thread_create_and_run_params.rbi @@ -11,22 +11,12 @@ module OpenAI # [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to # execute this run. sig { returns(String) } - def assistant_id - end - - sig { params(_: String).returns(String) } - def assistant_id=(_) - end + attr_accessor :assistant_id # Override the default system message of the assistant. This is useful for # modifying the behavior on a per-run basis. sig { returns(T.nilable(String)) } - def instructions - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def instructions=(_) - end + attr_accessor :instructions # The maximum number of completion tokens that may be used over the course of the # run. The run will make a best effort to use only the number of completion tokens @@ -34,12 +24,7 @@ module OpenAI # completion tokens specified, the run will end with status `incomplete`. See # `incomplete_details` for more info. sig { returns(T.nilable(Integer)) } - def max_completion_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_completion_tokens=(_) - end + attr_accessor :max_completion_tokens # The maximum number of prompt tokens that may be used over the course of the run. # The run will make a best effort to use only the number of prompt tokens @@ -47,12 +32,7 @@ module OpenAI # prompt tokens specified, the run will end with status `incomplete`. See # `incomplete_details` for more info. sig { returns(T.nilable(Integer)) } - def max_prompt_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_prompt_tokens=(_) - end + attr_accessor :max_prompt_tokens # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -61,38 +41,23 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to # be used to execute this run. If a value is provided here, it will override the # model associated with the assistant. If not, the model associated with the # assistant will be used. sig { returns(T.nilable(T.any(String, OpenAI::Models::ChatModel::OrSymbol))) } - def model - end - - sig do - params(_: T.nilable(T.any(String, OpenAI::Models::ChatModel::OrSymbol))) - .returns(T.nilable(T.any(String, OpenAI::Models::ChatModel::OrSymbol))) - end - def model=(_) - end + attr_accessor :model # Whether to enable # [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) # during tool use. sig { returns(T.nilable(T::Boolean)) } - def parallel_tool_calls - end + attr_reader :parallel_tool_calls - sig { params(_: T::Boolean).returns(T::Boolean) } - def parallel_tool_calls=(_) - end + sig { params(parallel_tool_calls: T::Boolean).void } + attr_writer :parallel_tool_calls # Specifies the format that the model must output. Compatible with # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -126,57 +91,21 @@ module OpenAI ) ) end - def response_format - end - - sig do - params( - _: T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - .returns( - T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - end - def response_format=(_) - end + attr_accessor :response_format # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more # focused and deterministic. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # Options to create a new thread. If no thread is provided when running a request, # an empty thread will be created. sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread)) } - def thread - end + attr_reader :thread - sig do - params(_: T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread, OpenAI::Util::AnyHash)) - end - def thread=(_) - end + sig { params(thread: T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread, OpenAI::Util::AnyHash)).void } + attr_writer :thread # Controls which (if any) tool is called by the model. `none` means the model will # not call any tools and instead generates a message. `auto` is the default value @@ -195,48 +124,22 @@ module OpenAI ) ) end - def tool_choice - end - - sig do - params( - _: T.nilable( - T.any( - OpenAI::Models::Beta::AssistantToolChoiceOption::Auto::OrSymbol, - OpenAI::Models::Beta::AssistantToolChoice - ) - ) - ) - .returns( - T.nilable( - T.any( - OpenAI::Models::Beta::AssistantToolChoiceOption::Auto::OrSymbol, - OpenAI::Models::Beta::AssistantToolChoice - ) - ) - ) - end - def tool_choice=(_) - end + attr_accessor :tool_choice # A set of resources that are used by the assistant's tools. The resources are # specific to the type of tool. For example, the `code_interpreter` tool requires # a list of file IDs, while the `file_search` tool requires a list of vector store # IDs. sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources)) } - def tool_resources - end + attr_reader :tool_resources sig do params( - _: T.nilable(T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, OpenAI::Util::AnyHash)) + tool_resources: T.nilable(T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, OpenAI::Util::AnyHash)) ) - .returns( - T.nilable(T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources, OpenAI::Util::AnyHash)) - ) - end - def tool_resources=(_) + .void end + attr_writer :tool_resources # Override the tools the assistant can use for this run. This is useful for # modifying the behavior on a per-run basis. @@ -253,35 +156,7 @@ module OpenAI ) ) end - def tools - end - - sig do - params( - _: T.nilable( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - ) - .returns( - T.nilable( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - ) - end - def tools=(_) - end + attr_accessor :tools # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -289,33 +164,22 @@ module OpenAI # # We generally recommend altering this or temperature but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy)) } - def truncation_strategy - end + attr_reader :truncation_strategy sig do params( - _: T.nilable( + truncation_strategy: T.nilable( T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, OpenAI::Util::AnyHash) ) ) - .returns( - T.nilable( - T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy, OpenAI::Util::AnyHash) - ) - ) - end - def truncation_strategy=(_) + .void end + attr_writer :truncation_strategy sig do params( @@ -449,19 +313,15 @@ module OpenAI # A list of [messages](https://platform.openai.com/docs/api-reference/messages) to # start the thread with. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message])) } - def messages - end + attr_reader :messages sig do params( - _: T::Array[T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message, OpenAI::Util::AnyHash)] + messages: T::Array[T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message, OpenAI::Util::AnyHash)] ) - .returns( - T::Array[T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message, OpenAI::Util::AnyHash)] - ) - end - def messages=(_) + .void end + attr_writer :messages # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -470,35 +330,24 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # A set of resources that are made available to the assistant's tools in this # thread. The resources are specific to the type of tool. For example, the # `code_interpreter` tool requires a list of file IDs, while the `file_search` # tool requires a list of vector store IDs. sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources)) } - def tool_resources - end + attr_reader :tool_resources sig do params( - _: T.nilable( + tool_resources: T.nilable( T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources, OpenAI::Util::AnyHash) ) ) - .returns( - T.nilable( - T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources, OpenAI::Util::AnyHash) - ) - ) - end - def tool_resources=(_) + .void end + attr_writer :tool_resources # Options to create a new thread. If no thread is provided when running a request, # an empty thread will be created. @@ -544,37 +393,7 @@ module OpenAI ) ) end - def content - end - - sig do - params( - _: T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlockParam - ) - ] - ) - ) - .returns( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlockParam - ) - ] - ) - ) - end - def content=(_) - end + attr_accessor :content # The role of the entity that is creating the message. Allowed values include: # @@ -583,29 +402,11 @@ module OpenAI # - `assistant`: Indicates the message is generated by the assistant. Use this # value to insert messages from the assistant into the conversation. sig { returns(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Role::OrSymbol) } - def role - end - - sig do - params(_: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Role::OrSymbol) - .returns(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Role::OrSymbol) - end - def role=(_) - end + attr_accessor :role # A list of files attached to the message, and the tools they should be added to. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment])) } - def attachments - end - - sig do - params( - _: T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment]) - ) - .returns(T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment])) - end - def attachments=(_) - end + attr_accessor :attachments # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -614,12 +415,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( @@ -743,12 +539,10 @@ module OpenAI class Attachment < OpenAI::BaseModel # The ID of the file to attach to the message. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The tools to add this file to. sig do @@ -763,12 +557,11 @@ module OpenAI ) ) end - def tools - end + attr_reader :tools sig do params( - _: T::Array[ + tools: T::Array[ T.any( OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Util::AnyHash, @@ -776,18 +569,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::Tool::FileSearch - ) - ] - ) - end - def tools=(_) + .void end + attr_writer :tools sig do params( @@ -838,12 +622,7 @@ module OpenAI class FileSearch < OpenAI::BaseModel # The type of tool being defined: `file_search` sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } def self.new(type: :file_search) @@ -870,46 +649,32 @@ module OpenAI class ToolResources < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do params( - _: T.any( + code_interpreter: T.any( OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::CodeInterpreter, - OpenAI::Util::AnyHash - ) - ) - end - def code_interpreter=(_) + .void end + attr_writer :code_interpreter sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch)) } - def file_search - end + attr_reader :file_search sig do params( - _: T.any( + file_search: T.any( OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch, - OpenAI::Util::AnyHash - ) - ) - end - def file_search=(_) + .void end + attr_writer :file_search # A set of resources that are made available to the assistant's tools in this # thread. The resources are specific to the type of tool. For example, the @@ -948,12 +713,10 @@ module OpenAI # available to the `code_interpreter` tool. There can be a maximum of 20 files # associated with the tool. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } def self.new(file_ids: nil) @@ -970,12 +733,10 @@ module OpenAI # attached to this thread. There can be a maximum of 1 vector store attached to # the thread. sig { returns(T.nilable(T::Array[String])) } - def vector_store_ids - end + attr_reader :vector_store_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + sig { params(vector_store_ids: T::Array[String]).void } + attr_writer :vector_store_ids # A helper to create a # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) @@ -988,29 +749,20 @@ module OpenAI ) ) end - def vector_stores - end + attr_reader :vector_stores sig do params( - _: T::Array[ + vector_stores: T::Array[ T.any( OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore, OpenAI::Util::AnyHash ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore, - OpenAI::Util::AnyHash - ) - ] - ) - end - def vector_stores=(_) + .void end + attr_writer :vector_stores sig do params( @@ -1052,38 +804,28 @@ module OpenAI ) ) end - def chunking_strategy - end + attr_reader :chunking_strategy sig do params( - _: T.any( + chunking_strategy: T.any( OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Util::AnyHash, OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static ) ) - .returns( - T.any( - OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static - ) - ) - end - def chunking_strategy=(_) + .void end + attr_writer :chunking_strategy # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to # add to the vector store. There can be a maximum of 10000 files in a vector # store. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -1092,14 +834,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig do - params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) - end - def metadata=(_) - end + attr_accessor :metadata sig do params( @@ -1150,12 +885,7 @@ module OpenAI class Auto < OpenAI::BaseModel # Always `auto`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. @@ -1174,34 +904,22 @@ module OpenAI OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static ) end - def static - end + attr_reader :static sig do params( - _: T.any( + static: T.any( OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static, - OpenAI::Util::AnyHash - ) - ) - end - def static=(_) + .void end + attr_writer :static # Always `static`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params( @@ -1233,22 +951,12 @@ module OpenAI # # Note that the overlap must not exceed half of `max_chunk_size_tokens`. sig { returns(Integer) } - def chunk_overlap_tokens - end - - sig { params(_: Integer).returns(Integer) } - def chunk_overlap_tokens=(_) - end + attr_accessor :chunk_overlap_tokens # The maximum number of tokens in each chunk. The default value is `800`. The # minimum value is `100` and the maximum value is `4096`. sig { returns(Integer) } - def max_chunk_size_tokens - end - - sig { params(_: Integer).returns(Integer) } - def max_chunk_size_tokens=(_) - end + attr_accessor :max_chunk_size_tokens sig do params( @@ -1285,40 +993,29 @@ module OpenAI class ToolResources < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do params( - _: T.any( + code_interpreter: T.any( OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::CodeInterpreter, - OpenAI::Util::AnyHash - ) - ) - end - def code_interpreter=(_) + .void end + attr_writer :code_interpreter sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch)) } - def file_search - end + attr_reader :file_search sig do params( - _: T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) + file_search: T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::ThreadCreateAndRunParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) - ) - end - def file_search=(_) + .void end + attr_writer :file_search # A set of resources that are used by the assistant's tools. The resources are # specific to the type of tool. For example, the `code_interpreter` tool requires @@ -1354,12 +1051,10 @@ module OpenAI # available to the `code_interpreter` tool. There can be a maximum of 20 files # associated with the tool. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } def self.new(file_ids: nil) @@ -1376,12 +1071,10 @@ module OpenAI # attached to this assistant. There can be a maximum of 1 vector store attached to # the assistant. sig { returns(T.nilable(T::Array[String])) } - def vector_store_ids - end + attr_reader :vector_store_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + sig { params(vector_store_ids: T::Array[String]).void } + attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } def self.new(vector_store_ids: nil) @@ -1425,25 +1118,12 @@ module OpenAI # the thread. When set to `auto`, messages in the middle of the thread will be # dropped to fit the context length of the model, `max_prompt_tokens`. sig { returns(OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::OrSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::OrSymbol) - .returns(OpenAI::Models::Beta::ThreadCreateAndRunParams::TruncationStrategy::Type::OrSymbol) - end - def type=(_) - end + attr_accessor :type # The number of most recent messages from the thread when constructing the context # for the run. sig { returns(T.nilable(Integer)) } - def last_messages - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def last_messages=(_) - end + attr_accessor :last_messages # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. diff --git a/rbi/lib/openai/models/beta/thread_create_params.rbi b/rbi/lib/openai/models/beta/thread_create_params.rbi index 4fab7a4b..fe346edf 100644 --- a/rbi/lib/openai/models/beta/thread_create_params.rbi +++ b/rbi/lib/openai/models/beta/thread_create_params.rbi @@ -10,15 +10,15 @@ module OpenAI # A list of [messages](https://platform.openai.com/docs/api-reference/messages) to # start the thread with. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateParams::Message])) } - def messages - end + attr_reader :messages sig do - params(_: T::Array[T.any(OpenAI::Models::Beta::ThreadCreateParams::Message, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Beta::ThreadCreateParams::Message, OpenAI::Util::AnyHash)]) - end - def messages=(_) + params( + messages: T::Array[T.any(OpenAI::Models::Beta::ThreadCreateParams::Message, OpenAI::Util::AnyHash)] + ) + .void end + attr_writer :messages # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -27,29 +27,22 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # A set of resources that are made available to the assistant's tools in this # thread. The resources are specific to the type of tool. For example, the # `code_interpreter` tool requires a list of file IDs, while the `file_search` # tool requires a list of vector store IDs. sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateParams::ToolResources)) } - def tool_resources - end + attr_reader :tool_resources sig do params( - _: T.nilable(T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources, OpenAI::Util::AnyHash)) + tool_resources: T.nilable(T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources, OpenAI::Util::AnyHash)) ) - .returns(T.nilable(T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources, OpenAI::Util::AnyHash))) - end - def tool_resources=(_) + .void end + attr_writer :tool_resources sig do params( @@ -93,37 +86,7 @@ module OpenAI ) ) end - def content - end - - sig do - params( - _: T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlockParam - ) - ] - ) - ) - .returns( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlockParam - ) - ] - ) - ) - end - def content=(_) - end + attr_accessor :content # The role of the entity that is creating the message. Allowed values include: # @@ -132,27 +95,11 @@ module OpenAI # - `assistant`: Indicates the message is generated by the assistant. Use this # value to insert messages from the assistant into the conversation. sig { returns(OpenAI::Models::Beta::ThreadCreateParams::Message::Role::OrSymbol) } - def role - end - - sig do - params(_: OpenAI::Models::Beta::ThreadCreateParams::Message::Role::OrSymbol) - .returns(OpenAI::Models::Beta::ThreadCreateParams::Message::Role::OrSymbol) - end - def role=(_) - end + attr_accessor :role # A list of files attached to the message, and the tools they should be added to. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment])) } - def attachments - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment])) - .returns(T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment])) - end - def attachments=(_) - end + attr_accessor :attachments # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -161,12 +108,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( @@ -285,12 +227,10 @@ module OpenAI class Attachment < OpenAI::BaseModel # The ID of the file to attach to the message. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The tools to add this file to. sig do @@ -305,12 +245,11 @@ module OpenAI ) ) end - def tools - end + attr_reader :tools sig do params( - _: T::Array[ + tools: T::Array[ T.any( OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Util::AnyHash, @@ -318,18 +257,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::Tool::FileSearch - ) - ] - ) - end - def tools=(_) + .void end + attr_writer :tools sig do params( @@ -380,12 +310,7 @@ module OpenAI class FileSearch < OpenAI::BaseModel # The type of tool being defined: `file_search` sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } def self.new(type: :file_search) @@ -412,32 +337,26 @@ module OpenAI class ToolResources < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateParams::ToolResources::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do params( - _: T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) + code_interpreter: T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) - ) - end - def code_interpreter=(_) + .void end + attr_writer :code_interpreter sig { returns(T.nilable(OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch)) } - def file_search - end + attr_reader :file_search sig do params( - _: T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) + file_search: T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) ) - .returns(T.any(OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash)) - end - def file_search=(_) + .void end + attr_writer :file_search # A set of resources that are made available to the assistant's tools in this # thread. The resources are specific to the type of tool. For example, the @@ -470,12 +389,10 @@ module OpenAI # available to the `code_interpreter` tool. There can be a maximum of 20 files # associated with the tool. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } def self.new(file_ids: nil) @@ -492,12 +409,10 @@ module OpenAI # attached to this thread. There can be a maximum of 1 vector store attached to # the thread. sig { returns(T.nilable(T::Array[String])) } - def vector_store_ids - end + attr_reader :vector_store_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + sig { params(vector_store_ids: T::Array[String]).void } + attr_writer :vector_store_ids # A helper to create a # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) @@ -508,29 +423,20 @@ module OpenAI T.nilable(T::Array[OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore]) ) end - def vector_stores - end + attr_reader :vector_stores sig do params( - _: T::Array[ + vector_stores: T::Array[ T.any( OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore, OpenAI::Util::AnyHash ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore, - OpenAI::Util::AnyHash - ) - ] - ) - end - def vector_stores=(_) + .void end + attr_writer :vector_stores sig do params( @@ -572,38 +478,28 @@ module OpenAI ) ) end - def chunking_strategy - end + attr_reader :chunking_strategy sig do params( - _: T.any( + chunking_strategy: T.any( OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Util::AnyHash, OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static ) ) - .returns( - T.any( - OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static - ) - ) - end - def chunking_strategy=(_) + .void end + attr_writer :chunking_strategy # A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to # add to the vector store. There can be a maximum of 10000 files in a vector # store. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -612,14 +508,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig do - params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) - end - def metadata=(_) - end + attr_accessor :metadata sig do params( @@ -670,12 +559,7 @@ module OpenAI class Auto < OpenAI::BaseModel # Always `auto`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The default strategy. This strategy currently uses a `max_chunk_size_tokens` of # `800` and `chunk_overlap_tokens` of `400`. @@ -694,34 +578,22 @@ module OpenAI OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static ) end - def static - end + attr_reader :static sig do params( - _: T.any( + static: T.any( OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::ThreadCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static, - OpenAI::Util::AnyHash - ) - ) - end - def static=(_) + .void end + attr_writer :static # Always `static`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params( @@ -753,22 +625,12 @@ module OpenAI # # Note that the overlap must not exceed half of `max_chunk_size_tokens`. sig { returns(Integer) } - def chunk_overlap_tokens - end - - sig { params(_: Integer).returns(Integer) } - def chunk_overlap_tokens=(_) - end + attr_accessor :chunk_overlap_tokens # The maximum number of tokens in each chunk. The default value is `800`. The # minimum value is `100` and the maximum value is `4096`. sig { returns(Integer) } - def max_chunk_size_tokens - end - - sig { params(_: Integer).returns(Integer) } - def max_chunk_size_tokens=(_) - end + attr_accessor :max_chunk_size_tokens sig do params( diff --git a/rbi/lib/openai/models/beta/thread_deleted.rbi b/rbi/lib/openai/models/beta/thread_deleted.rbi index 1ca71e29..cc908f49 100644 --- a/rbi/lib/openai/models/beta/thread_deleted.rbi +++ b/rbi/lib/openai/models/beta/thread_deleted.rbi @@ -5,28 +5,13 @@ module OpenAI module Beta class ThreadDeleted < OpenAI::BaseModel sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id sig { returns(T::Boolean) } - def deleted - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def deleted=(_) - end + attr_accessor :deleted sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } def self.new(id:, deleted:, object: :"thread.deleted") diff --git a/rbi/lib/openai/models/beta/thread_stream_event.rbi b/rbi/lib/openai/models/beta/thread_stream_event.rbi index 84e72f6e..53d58531 100644 --- a/rbi/lib/openai/models/beta/thread_stream_event.rbi +++ b/rbi/lib/openai/models/beta/thread_stream_event.rbi @@ -7,32 +7,20 @@ module OpenAI # Represents a thread that contains # [messages](https://platform.openai.com/docs/api-reference/messages). sig { returns(OpenAI::Models::Beta::Thread) } - def data - end + attr_reader :data - sig do - params(_: T.any(OpenAI::Models::Beta::Thread, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Thread, OpenAI::Util::AnyHash)) - end - def data=(_) - end + sig { params(data: T.any(OpenAI::Models::Beta::Thread, OpenAI::Util::AnyHash)).void } + attr_writer :data sig { returns(Symbol) } - def event - end - - sig { params(_: Symbol).returns(Symbol) } - def event=(_) - end + attr_accessor :event # Whether to enable input audio transcription. sig { returns(T.nilable(T::Boolean)) } - def enabled - end + attr_reader :enabled - sig { params(_: T::Boolean).returns(T::Boolean) } - def enabled=(_) - end + sig { params(enabled: T::Boolean).void } + attr_writer :enabled # Occurs when a new # [thread](https://platform.openai.com/docs/api-reference/threads/object) is diff --git a/rbi/lib/openai/models/beta/thread_update_params.rbi b/rbi/lib/openai/models/beta/thread_update_params.rbi index 97e08dd0..d5156fc0 100644 --- a/rbi/lib/openai/models/beta/thread_update_params.rbi +++ b/rbi/lib/openai/models/beta/thread_update_params.rbi @@ -14,29 +14,22 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # A set of resources that are made available to the assistant's tools in this # thread. The resources are specific to the type of tool. For example, the # `code_interpreter` tool requires a list of file IDs, while the `file_search` # tool requires a list of vector store IDs. sig { returns(T.nilable(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources)) } - def tool_resources - end + attr_reader :tool_resources sig do params( - _: T.nilable(T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources, OpenAI::Util::AnyHash)) + tool_resources: T.nilable(T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources, OpenAI::Util::AnyHash)) ) - .returns(T.nilable(T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources, OpenAI::Util::AnyHash))) - end - def tool_resources=(_) + .void end + attr_writer :tool_resources sig do params( @@ -64,32 +57,26 @@ module OpenAI class ToolResources < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do params( - _: T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) + code_interpreter: T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::CodeInterpreter, OpenAI::Util::AnyHash) - ) - end - def code_interpreter=(_) + .void end + attr_writer :code_interpreter sig { returns(T.nilable(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::FileSearch)) } - def file_search - end + attr_reader :file_search sig do params( - _: T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) + file_search: T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash) ) - .returns(T.any(OpenAI::Models::Beta::ThreadUpdateParams::ToolResources::FileSearch, OpenAI::Util::AnyHash)) - end - def file_search=(_) + .void end + attr_writer :file_search # A set of resources that are made available to the assistant's tools in this # thread. The resources are specific to the type of tool. For example, the @@ -122,12 +109,10 @@ module OpenAI # available to the `code_interpreter` tool. There can be a maximum of 20 files # associated with the tool. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids sig { params(file_ids: T::Array[String]).returns(T.attached_class) } def self.new(file_ids: nil) @@ -144,12 +129,10 @@ module OpenAI # attached to this thread. There can be a maximum of 1 vector store attached to # the thread. sig { returns(T.nilable(T::Array[String])) } - def vector_store_ids - end + attr_reader :vector_store_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + sig { params(vector_store_ids: T::Array[String]).void } + attr_writer :vector_store_ids sig { params(vector_store_ids: T::Array[String]).returns(T.attached_class) } def self.new(vector_store_ids: nil) diff --git a/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi b/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi index e41f739a..c8f84631 100644 --- a/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi +++ b/rbi/lib/openai/models/beta/threads/file_citation_annotation.rbi @@ -6,51 +6,29 @@ module OpenAI module Threads class FileCitationAnnotation < OpenAI::BaseModel sig { returns(Integer) } - def end_index - end - - sig { params(_: Integer).returns(Integer) } - def end_index=(_) - end + attr_accessor :end_index sig { returns(OpenAI::Models::Beta::Threads::FileCitationAnnotation::FileCitation) } - def file_citation - end + attr_reader :file_citation sig do params( - _: T.any(OpenAI::Models::Beta::Threads::FileCitationAnnotation::FileCitation, OpenAI::Util::AnyHash) + file_citation: T.any(OpenAI::Models::Beta::Threads::FileCitationAnnotation::FileCitation, OpenAI::Util::AnyHash) ) - .returns(T.any(OpenAI::Models::Beta::Threads::FileCitationAnnotation::FileCitation, OpenAI::Util::AnyHash)) - end - def file_citation=(_) + .void end + attr_writer :file_citation sig { returns(Integer) } - def start_index - end - - sig { params(_: Integer).returns(Integer) } - def start_index=(_) - end + attr_accessor :start_index # The text in the message content that needs to be replaced. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # Always `file_citation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A citation within the message that points to a specific quote from a specific # File associated with the assistant or the message. Generated when the assistant @@ -86,12 +64,7 @@ module OpenAI class FileCitation < OpenAI::BaseModel # The ID of the specific File the citation is from. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id sig { params(file_id: String).returns(T.attached_class) } def self.new(file_id:) diff --git a/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi b/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi index c825f31b..666708db 100644 --- a/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi +++ b/rbi/lib/openai/models/beta/threads/file_citation_delta_annotation.rbi @@ -7,61 +7,41 @@ module OpenAI class FileCitationDeltaAnnotation < OpenAI::BaseModel # The index of the annotation in the text content part. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Always `file_citation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(Integer)) } - def end_index - end + attr_reader :end_index - sig { params(_: Integer).returns(Integer) } - def end_index=(_) - end + sig { params(end_index: Integer).void } + attr_writer :end_index sig { returns(T.nilable(OpenAI::Models::Beta::Threads::FileCitationDeltaAnnotation::FileCitation)) } - def file_citation - end + attr_reader :file_citation sig do params( - _: T.any(OpenAI::Models::Beta::Threads::FileCitationDeltaAnnotation::FileCitation, OpenAI::Util::AnyHash) + file_citation: T.any(OpenAI::Models::Beta::Threads::FileCitationDeltaAnnotation::FileCitation, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::Threads::FileCitationDeltaAnnotation::FileCitation, OpenAI::Util::AnyHash) - ) - end - def file_citation=(_) + .void end + attr_writer :file_citation sig { returns(T.nilable(Integer)) } - def start_index - end + attr_reader :start_index - sig { params(_: Integer).returns(Integer) } - def start_index=(_) - end + sig { params(start_index: Integer).void } + attr_writer :start_index # The text in the message content that needs to be replaced. sig { returns(T.nilable(String)) } - def text - end + attr_reader :text - sig { params(_: String).returns(String) } - def text=(_) - end + sig { params(text: String).void } + attr_writer :text # A citation within the message that points to a specific quote from a specific # File associated with the assistant or the message. Generated when the assistant @@ -99,21 +79,17 @@ module OpenAI class FileCitation < OpenAI::BaseModel # The ID of the specific File the citation is from. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The specific quote in the file. sig { returns(T.nilable(String)) } - def quote - end + attr_reader :quote - sig { params(_: String).returns(String) } - def quote=(_) - end + sig { params(quote: String).void } + attr_writer :quote sig { params(file_id: String, quote: String).returns(T.attached_class) } def self.new(file_id: nil, quote: nil) diff --git a/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi b/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi index dd673abd..33a5f4e1 100644 --- a/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi +++ b/rbi/lib/openai/models/beta/threads/file_path_annotation.rbi @@ -6,49 +6,29 @@ module OpenAI module Threads class FilePathAnnotation < OpenAI::BaseModel sig { returns(Integer) } - def end_index - end - - sig { params(_: Integer).returns(Integer) } - def end_index=(_) - end + attr_accessor :end_index sig { returns(OpenAI::Models::Beta::Threads::FilePathAnnotation::FilePath) } - def file_path - end + attr_reader :file_path sig do - params(_: T.any(OpenAI::Models::Beta::Threads::FilePathAnnotation::FilePath, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::FilePathAnnotation::FilePath, OpenAI::Util::AnyHash)) - end - def file_path=(_) + params( + file_path: T.any(OpenAI::Models::Beta::Threads::FilePathAnnotation::FilePath, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :file_path sig { returns(Integer) } - def start_index - end - - sig { params(_: Integer).returns(Integer) } - def start_index=(_) - end + attr_accessor :start_index # The text in the message content that needs to be replaced. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # Always `file_path`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A URL for the file that's generated when the assistant used the # `code_interpreter` tool to generate a file. @@ -83,12 +63,7 @@ module OpenAI class FilePath < OpenAI::BaseModel # The ID of the file that was generated. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id sig { params(file_id: String).returns(T.attached_class) } def self.new(file_id:) diff --git a/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi b/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi index b154c4d8..7c79aae6 100644 --- a/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi +++ b/rbi/lib/openai/models/beta/threads/file_path_delta_annotation.rbi @@ -7,57 +7,41 @@ module OpenAI class FilePathDeltaAnnotation < OpenAI::BaseModel # The index of the annotation in the text content part. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Always `file_path`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(Integer)) } - def end_index - end + attr_reader :end_index - sig { params(_: Integer).returns(Integer) } - def end_index=(_) - end + sig { params(end_index: Integer).void } + attr_writer :end_index sig { returns(T.nilable(OpenAI::Models::Beta::Threads::FilePathDeltaAnnotation::FilePath)) } - def file_path - end + attr_reader :file_path sig do - params(_: T.any(OpenAI::Models::Beta::Threads::FilePathDeltaAnnotation::FilePath, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::FilePathDeltaAnnotation::FilePath, OpenAI::Util::AnyHash)) - end - def file_path=(_) + params( + file_path: T.any(OpenAI::Models::Beta::Threads::FilePathDeltaAnnotation::FilePath, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :file_path sig { returns(T.nilable(Integer)) } - def start_index - end + attr_reader :start_index - sig { params(_: Integer).returns(Integer) } - def start_index=(_) - end + sig { params(start_index: Integer).void } + attr_writer :start_index # The text in the message content that needs to be replaced. sig { returns(T.nilable(String)) } - def text - end + attr_reader :text - sig { params(_: String).returns(String) } - def text=(_) - end + sig { params(text: String).void } + attr_writer :text # A URL for the file that's generated when the assistant used the # `code_interpreter` tool to generate a file. @@ -94,12 +78,10 @@ module OpenAI class FilePath < OpenAI::BaseModel # The ID of the file that was generated. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id sig { params(file_id: String).returns(T.attached_class) } def self.new(file_id: nil) diff --git a/rbi/lib/openai/models/beta/threads/image_file.rbi b/rbi/lib/openai/models/beta/threads/image_file.rbi index edcd6cf4..e7cc0c6e 100644 --- a/rbi/lib/openai/models/beta/threads/image_file.rbi +++ b/rbi/lib/openai/models/beta/threads/image_file.rbi @@ -9,25 +9,15 @@ module OpenAI # in the message content. Set `purpose="vision"` when uploading the File if you # need to later display the file content. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # Specifies the detail level of the image if specified by the user. `low` uses # fewer tokens, you can opt in to high resolution using `high`. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::ImageFile::Detail::OrSymbol)) } - def detail - end + attr_reader :detail - sig do - params(_: OpenAI::Models::Beta::Threads::ImageFile::Detail::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::ImageFile::Detail::OrSymbol) - end - def detail=(_) - end + sig { params(detail: OpenAI::Models::Beta::Threads::ImageFile::Detail::OrSymbol).void } + attr_writer :detail sig do params(file_id: String, detail: OpenAI::Models::Beta::Threads::ImageFile::Detail::OrSymbol) diff --git a/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi b/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi index 4c2d8b93..18986902 100644 --- a/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi +++ b/rbi/lib/openai/models/beta/threads/image_file_content_block.rbi @@ -6,24 +6,14 @@ module OpenAI module Threads class ImageFileContentBlock < OpenAI::BaseModel sig { returns(OpenAI::Models::Beta::Threads::ImageFile) } - def image_file - end + attr_reader :image_file - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::ImageFile, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::ImageFile, OpenAI::Util::AnyHash)) - end - def image_file=(_) - end + sig { params(image_file: T.any(OpenAI::Models::Beta::Threads::ImageFile, OpenAI::Util::AnyHash)).void } + attr_writer :image_file # Always `image_file`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # References an image [File](https://platform.openai.com/docs/api-reference/files) # in the content of a message. diff --git a/rbi/lib/openai/models/beta/threads/image_file_delta.rbi b/rbi/lib/openai/models/beta/threads/image_file_delta.rbi index 3d650791..a560c68b 100644 --- a/rbi/lib/openai/models/beta/threads/image_file_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/image_file_delta.rbi @@ -8,26 +8,19 @@ module OpenAI # Specifies the detail level of the image if specified by the user. `low` uses # fewer tokens, you can opt in to high resolution using `high`. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::ImageFileDelta::Detail::TaggedSymbol)) } - def detail - end + attr_reader :detail - sig do - params(_: OpenAI::Models::Beta::Threads::ImageFileDelta::Detail::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::ImageFileDelta::Detail::OrSymbol) - end - def detail=(_) - end + sig { params(detail: OpenAI::Models::Beta::Threads::ImageFileDelta::Detail::OrSymbol).void } + attr_writer :detail # The [File](https://platform.openai.com/docs/api-reference/files) ID of the image # in the message content. Set `purpose="vision"` when uploading the File if you # need to later display the file content. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id sig do params(detail: OpenAI::Models::Beta::Threads::ImageFileDelta::Detail::OrSymbol, file_id: String) diff --git a/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi b/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi index 6aa45d0d..3dcd3939 100644 --- a/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi +++ b/rbi/lib/openai/models/beta/threads/image_file_delta_block.rbi @@ -7,32 +7,17 @@ module OpenAI class ImageFileDeltaBlock < OpenAI::BaseModel # The index of the content part in the message. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Always `image_file`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(OpenAI::Models::Beta::Threads::ImageFileDelta)) } - def image_file - end + attr_reader :image_file - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::ImageFileDelta, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::ImageFileDelta, OpenAI::Util::AnyHash)) - end - def image_file=(_) - end + sig { params(image_file: T.any(OpenAI::Models::Beta::Threads::ImageFileDelta, OpenAI::Util::AnyHash)).void } + attr_writer :image_file # References an image [File](https://platform.openai.com/docs/api-reference/files) # in the content of a message. diff --git a/rbi/lib/openai/models/beta/threads/image_url.rbi b/rbi/lib/openai/models/beta/threads/image_url.rbi index 9b0d2994..c27cc50c 100644 --- a/rbi/lib/openai/models/beta/threads/image_url.rbi +++ b/rbi/lib/openai/models/beta/threads/image_url.rbi @@ -8,25 +8,15 @@ module OpenAI # The external URL of the image, must be a supported image types: jpeg, jpg, png, # gif, webp. sig { returns(String) } - def url - end - - sig { params(_: String).returns(String) } - def url=(_) - end + attr_accessor :url # Specifies the detail level of the image. `low` uses fewer tokens, you can opt in # to high resolution using `high`. Default value is `auto` sig { returns(T.nilable(OpenAI::Models::Beta::Threads::ImageURL::Detail::OrSymbol)) } - def detail - end + attr_reader :detail - sig do - params(_: OpenAI::Models::Beta::Threads::ImageURL::Detail::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::ImageURL::Detail::OrSymbol) - end - def detail=(_) - end + sig { params(detail: OpenAI::Models::Beta::Threads::ImageURL::Detail::OrSymbol).void } + attr_writer :detail sig do params(url: String, detail: OpenAI::Models::Beta::Threads::ImageURL::Detail::OrSymbol) diff --git a/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi b/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi index 7a20b522..2c1839ed 100644 --- a/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi +++ b/rbi/lib/openai/models/beta/threads/image_url_content_block.rbi @@ -6,24 +6,14 @@ module OpenAI module Threads class ImageURLContentBlock < OpenAI::BaseModel sig { returns(OpenAI::Models::Beta::Threads::ImageURL) } - def image_url - end + attr_reader :image_url - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::ImageURL, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::ImageURL, OpenAI::Util::AnyHash)) - end - def image_url=(_) - end + sig { params(image_url: T.any(OpenAI::Models::Beta::Threads::ImageURL, OpenAI::Util::AnyHash)).void } + attr_writer :image_url # The type of the content part. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # References an image URL in the content of a message. sig do diff --git a/rbi/lib/openai/models/beta/threads/image_url_delta.rbi b/rbi/lib/openai/models/beta/threads/image_url_delta.rbi index ac2e9bb6..e317b878 100644 --- a/rbi/lib/openai/models/beta/threads/image_url_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/image_url_delta.rbi @@ -8,25 +8,18 @@ module OpenAI # Specifies the detail level of the image. `low` uses fewer tokens, you can opt in # to high resolution using `high`. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::ImageURLDelta::Detail::TaggedSymbol)) } - def detail - end + attr_reader :detail - sig do - params(_: OpenAI::Models::Beta::Threads::ImageURLDelta::Detail::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::ImageURLDelta::Detail::OrSymbol) - end - def detail=(_) - end + sig { params(detail: OpenAI::Models::Beta::Threads::ImageURLDelta::Detail::OrSymbol).void } + attr_writer :detail # The URL of the image, must be a supported image types: jpeg, jpg, png, gif, # webp. sig { returns(T.nilable(String)) } - def url - end + attr_reader :url - sig { params(_: String).returns(String) } - def url=(_) - end + sig { params(url: String).void } + attr_writer :url sig do params(detail: OpenAI::Models::Beta::Threads::ImageURLDelta::Detail::OrSymbol, url: String) diff --git a/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi b/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi index 5b278b0a..664de983 100644 --- a/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi +++ b/rbi/lib/openai/models/beta/threads/image_url_delta_block.rbi @@ -7,32 +7,17 @@ module OpenAI class ImageURLDeltaBlock < OpenAI::BaseModel # The index of the content part in the message. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Always `image_url`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(OpenAI::Models::Beta::Threads::ImageURLDelta)) } - def image_url - end + attr_reader :image_url - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::ImageURLDelta, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::ImageURLDelta, OpenAI::Util::AnyHash)) - end - def image_url=(_) - end + sig { params(image_url: T.any(OpenAI::Models::Beta::Threads::ImageURLDelta, OpenAI::Util::AnyHash)).void } + attr_writer :image_url # References an image URL in the content of a message. sig do diff --git a/rbi/lib/openai/models/beta/threads/message.rbi b/rbi/lib/openai/models/beta/threads/message.rbi index 63ead9a1..bf9c7500 100644 --- a/rbi/lib/openai/models/beta/threads/message.rbi +++ b/rbi/lib/openai/models/beta/threads/message.rbi @@ -7,44 +7,21 @@ module OpenAI class Message < OpenAI::BaseModel # The identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # If applicable, the ID of the # [assistant](https://platform.openai.com/docs/api-reference/assistants) that # authored this message. sig { returns(T.nilable(String)) } - def assistant_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def assistant_id=(_) - end + attr_accessor :assistant_id # A list of files attached to the message, and the tools they were added to. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::Message::Attachment])) } - def attachments - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Beta::Threads::Message::Attachment])) - .returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::Message::Attachment])) - end - def attachments=(_) - end + attr_accessor :attachments # The Unix timestamp (in seconds) for when the message was completed. sig { returns(T.nilable(Integer)) } - def completed_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def completed_at=(_) - end + attr_accessor :completed_at # The content of the message in array of text and/or images. sig do @@ -59,67 +36,27 @@ module OpenAI ] ) end - def content - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlock, - OpenAI::Models::Beta::Threads::RefusalContentBlock - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlock, - OpenAI::Models::Beta::Threads::RefusalContentBlock - ) - ] - ) - end - def content=(_) - end + attr_accessor :content # The Unix timestamp (in seconds) for when the message was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The Unix timestamp (in seconds) for when the message was marked as incomplete. sig { returns(T.nilable(Integer)) } - def incomplete_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def incomplete_at=(_) - end + attr_accessor :incomplete_at # On an incomplete message, details about why the message is incomplete. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Message::IncompleteDetails)) } - def incomplete_details - end + attr_reader :incomplete_details sig do params( - _: T.nilable(T.any(OpenAI::Models::Beta::Threads::Message::IncompleteDetails, OpenAI::Util::AnyHash)) + incomplete_details: T.nilable(T.any(OpenAI::Models::Beta::Threads::Message::IncompleteDetails, OpenAI::Util::AnyHash)) ) - .returns( - T.nilable(T.any(OpenAI::Models::Beta::Threads::Message::IncompleteDetails, OpenAI::Util::AnyHash)) - ) - end - def incomplete_details=(_) + .void end + attr_writer :incomplete_details # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -128,67 +65,31 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The object type, which is always `thread.message`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The entity that produced the message. One of `user` or `assistant`. sig { returns(OpenAI::Models::Beta::Threads::Message::Role::TaggedSymbol) } - def role - end - - sig do - params(_: OpenAI::Models::Beta::Threads::Message::Role::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::Message::Role::TaggedSymbol) - end - def role=(_) - end + attr_accessor :role # The ID of the [run](https://platform.openai.com/docs/api-reference/runs) # associated with the creation of this message. Value is `null` when messages are # created manually using the create message or create thread endpoints. sig { returns(T.nilable(String)) } - def run_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def run_id=(_) - end + attr_accessor :run_id # The status of the message, which can be either `in_progress`, `incomplete`, or # `completed`. sig { returns(OpenAI::Models::Beta::Threads::Message::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Beta::Threads::Message::Status::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::Message::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The [thread](https://platform.openai.com/docs/api-reference/threads) ID that # this message belongs to. sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id # Represents a message within a # [thread](https://platform.openai.com/docs/api-reference/threads). @@ -271,12 +172,10 @@ module OpenAI class Attachment < OpenAI::BaseModel # The ID of the file to attach to the message. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The tools to add this file to. sig do @@ -291,12 +190,11 @@ module OpenAI ) ) end - def tools - end + attr_reader :tools sig do params( - _: T::Array[ + tools: T::Array[ T.any( OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Util::AnyHash, @@ -304,18 +202,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::Threads::Message::Attachment::Tool::AssistantToolsFileSearchTypeOnly - ) - ] - ) - end - def tools=(_) + .void end + attr_writer :tools sig do params( @@ -366,12 +255,7 @@ module OpenAI class AssistantToolsFileSearchTypeOnly < OpenAI::BaseModel # The type of tool being defined: `file_search` sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } def self.new(type: :file_search) @@ -398,15 +282,7 @@ module OpenAI class IncompleteDetails < OpenAI::BaseModel # The reason the message is incomplete. sig { returns(OpenAI::Models::Beta::Threads::Message::IncompleteDetails::Reason::TaggedSymbol) } - def reason - end - - sig do - params(_: OpenAI::Models::Beta::Threads::Message::IncompleteDetails::Reason::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::Message::IncompleteDetails::Reason::TaggedSymbol) - end - def reason=(_) - end + attr_accessor :reason # On an incomplete message, details about why the message is incomplete. sig do diff --git a/rbi/lib/openai/models/beta/threads/message_create_params.rbi b/rbi/lib/openai/models/beta/threads/message_create_params.rbi index 350fd7ae..f65aa74e 100644 --- a/rbi/lib/openai/models/beta/threads/message_create_params.rbi +++ b/rbi/lib/openai/models/beta/threads/message_create_params.rbi @@ -23,37 +23,7 @@ module OpenAI ) ) end - def content - end - - sig do - params( - _: T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlockParam - ) - ] - ) - ) - .returns( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlockParam - ) - ] - ) - ) - end - def content=(_) - end + attr_accessor :content # The role of the entity that is creating the message. Allowed values include: # @@ -62,27 +32,11 @@ module OpenAI # - `assistant`: Indicates the message is generated by the assistant. Use this # value to insert messages from the assistant into the conversation. sig { returns(OpenAI::Models::Beta::Threads::MessageCreateParams::Role::OrSymbol) } - def role - end - - sig do - params(_: OpenAI::Models::Beta::Threads::MessageCreateParams::Role::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::MessageCreateParams::Role::OrSymbol) - end - def role=(_) - end + attr_accessor :role # A list of files attached to the message, and the tools they should be added to. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment])) } - def attachments - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment])) - .returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment])) - end - def attachments=(_) - end + attr_accessor :attachments # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -91,12 +45,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( @@ -217,12 +166,10 @@ module OpenAI class Attachment < OpenAI::BaseModel # The ID of the file to attach to the message. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The tools to add this file to. sig do @@ -237,12 +184,11 @@ module OpenAI ) ) end - def tools - end + attr_reader :tools sig do params( - _: T::Array[ + tools: T::Array[ T.any( OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Util::AnyHash, @@ -250,18 +196,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::Threads::MessageCreateParams::Attachment::Tool::FileSearch - ) - ] - ) - end - def tools=(_) + .void end + attr_writer :tools sig do params( @@ -312,12 +249,7 @@ module OpenAI class FileSearch < OpenAI::BaseModel # The type of tool being defined: `file_search` sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } def self.new(type: :file_search) diff --git a/rbi/lib/openai/models/beta/threads/message_delete_params.rbi b/rbi/lib/openai/models/beta/threads/message_delete_params.rbi index 74583e5c..dd6b3c5a 100644 --- a/rbi/lib/openai/models/beta/threads/message_delete_params.rbi +++ b/rbi/lib/openai/models/beta/threads/message_delete_params.rbi @@ -9,12 +9,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id sig do params(thread_id: String, request_options: T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash)) diff --git a/rbi/lib/openai/models/beta/threads/message_deleted.rbi b/rbi/lib/openai/models/beta/threads/message_deleted.rbi index 9684886b..df1dc2e2 100644 --- a/rbi/lib/openai/models/beta/threads/message_deleted.rbi +++ b/rbi/lib/openai/models/beta/threads/message_deleted.rbi @@ -6,28 +6,13 @@ module OpenAI module Threads class MessageDeleted < OpenAI::BaseModel sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id sig { returns(T::Boolean) } - def deleted - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def deleted=(_) - end + attr_accessor :deleted sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } def self.new(id:, deleted:, object: :"thread.message.deleted") diff --git a/rbi/lib/openai/models/beta/threads/message_delta.rbi b/rbi/lib/openai/models/beta/threads/message_delta.rbi index 0e044cb6..22b4e446 100644 --- a/rbi/lib/openai/models/beta/threads/message_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/message_delta.rbi @@ -20,12 +20,11 @@ module OpenAI ) ) end - def content - end + attr_reader :content sig do params( - _: T::Array[ + content: T::Array[ T.any( OpenAI::Models::Beta::Threads::ImageFileDeltaBlock, OpenAI::Util::AnyHash, @@ -35,32 +34,16 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileDeltaBlock, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::Threads::TextDeltaBlock, - OpenAI::Models::Beta::Threads::RefusalDeltaBlock, - OpenAI::Models::Beta::Threads::ImageURLDeltaBlock - ) - ] - ) - end - def content=(_) + .void end + attr_writer :content # The entity that produced the message. One of `user` or `assistant`. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::MessageDelta::Role::TaggedSymbol)) } - def role - end + attr_reader :role - sig do - params(_: OpenAI::Models::Beta::Threads::MessageDelta::Role::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::MessageDelta::Role::OrSymbol) - end - def role=(_) - end + sig { params(role: OpenAI::Models::Beta::Threads::MessageDelta::Role::OrSymbol).void } + attr_writer :role # The delta containing the fields that have changed on the Message. sig do diff --git a/rbi/lib/openai/models/beta/threads/message_delta_event.rbi b/rbi/lib/openai/models/beta/threads/message_delta_event.rbi index e52c4656..5ac1d6f1 100644 --- a/rbi/lib/openai/models/beta/threads/message_delta_event.rbi +++ b/rbi/lib/openai/models/beta/threads/message_delta_event.rbi @@ -7,33 +7,18 @@ module OpenAI class MessageDeltaEvent < OpenAI::BaseModel # The identifier of the message, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The delta containing the fields that have changed on the Message. sig { returns(OpenAI::Models::Beta::Threads::MessageDelta) } - def delta - end + attr_reader :delta - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::MessageDelta, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::MessageDelta, OpenAI::Util::AnyHash)) - end - def delta=(_) - end + sig { params(delta: T.any(OpenAI::Models::Beta::Threads::MessageDelta, OpenAI::Util::AnyHash)).void } + attr_writer :delta # The object type, which is always `thread.message.delta`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # Represents a message delta i.e. any changed fields on a message during # streaming. diff --git a/rbi/lib/openai/models/beta/threads/message_list_params.rbi b/rbi/lib/openai/models/beta/threads/message_list_params.rbi index aecbbbaa..be115f45 100644 --- a/rbi/lib/openai/models/beta/threads/message_list_params.rbi +++ b/rbi/lib/openai/models/beta/threads/message_list_params.rbi @@ -13,56 +13,43 @@ module OpenAI # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A cursor for use in pagination. `before` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # starting with obj_foo, your subsequent call can include before=obj_foo in order # to fetch the previous page of the list. sig { returns(T.nilable(String)) } - def before - end + attr_reader :before - sig { params(_: String).returns(String) } - def before=(_) - end + sig { params(before: String).void } + attr_writer :before # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order by the `created_at` timestamp of the objects. `asc` for ascending # order and `desc` for descending order. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::MessageListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::Beta::Threads::MessageListParams::Order::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::MessageListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::Beta::Threads::MessageListParams::Order::OrSymbol).void } + attr_writer :order # Filter messages by the run ID that generated them. sig { returns(T.nilable(String)) } - def run_id - end + attr_reader :run_id - sig { params(_: String).returns(String) } - def run_id=(_) - end + sig { params(run_id: String).void } + attr_writer :run_id sig do params( diff --git a/rbi/lib/openai/models/beta/threads/message_retrieve_params.rbi b/rbi/lib/openai/models/beta/threads/message_retrieve_params.rbi index ecc15e69..3c2f8ecd 100644 --- a/rbi/lib/openai/models/beta/threads/message_retrieve_params.rbi +++ b/rbi/lib/openai/models/beta/threads/message_retrieve_params.rbi @@ -9,12 +9,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id sig do params(thread_id: String, request_options: T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash)) diff --git a/rbi/lib/openai/models/beta/threads/message_update_params.rbi b/rbi/lib/openai/models/beta/threads/message_update_params.rbi index e25f66a7..fde62361 100644 --- a/rbi/lib/openai/models/beta/threads/message_update_params.rbi +++ b/rbi/lib/openai/models/beta/threads/message_update_params.rbi @@ -9,12 +9,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -23,12 +18,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( diff --git a/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi b/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi index c2179549..b9350051 100644 --- a/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi +++ b/rbi/lib/openai/models/beta/threads/refusal_content_block.rbi @@ -6,21 +6,11 @@ module OpenAI module Threads class RefusalContentBlock < OpenAI::BaseModel sig { returns(String) } - def refusal - end - - sig { params(_: String).returns(String) } - def refusal=(_) - end + attr_accessor :refusal # Always `refusal`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The refusal content generated by the assistant. sig { params(refusal: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi b/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi index 87dd9957..72b6092e 100644 --- a/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi +++ b/rbi/lib/openai/models/beta/threads/refusal_delta_block.rbi @@ -7,29 +7,17 @@ module OpenAI class RefusalDeltaBlock < OpenAI::BaseModel # The index of the refusal part in the message. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Always `refusal`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(String)) } - def refusal - end + attr_reader :refusal - sig { params(_: String).returns(String) } - def refusal=(_) - end + sig { params(refusal: String).void } + attr_writer :refusal # The refusal content that is part of a message. sig { params(index: Integer, refusal: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi b/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi index ce2250e5..f8511f4f 100644 --- a/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi +++ b/rbi/lib/openai/models/beta/threads/required_action_function_tool_call.rbi @@ -10,38 +10,24 @@ module OpenAI # [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) # endpoint. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The function definition. sig { returns(OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall::Function) } - def function - end + attr_reader :function sig do params( - _: T.any(OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall::Function, OpenAI::Util::AnyHash) + function: T.any(OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall::Function, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall::Function, OpenAI::Util::AnyHash) - ) - end - def function=(_) + .void end + attr_writer :function # The type of tool call the output is required for. For now, this is always # `function`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Tool call objects sig do @@ -67,21 +53,11 @@ module OpenAI class Function < OpenAI::BaseModel # The arguments that the model expects you to pass to the function. sig { returns(String) } - def arguments - end - - sig { params(_: String).returns(String) } - def arguments=(_) - end + attr_accessor :arguments # The name of the function. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # The function definition. sig { params(arguments: String, name: String).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/beta/threads/run.rbi b/rbi/lib/openai/models/beta/threads/run.rbi index c6efb6d4..5be2cbe4 100644 --- a/rbi/lib/openai/models/beta/threads/run.rbi +++ b/rbi/lib/openai/models/beta/threads/run.rbi @@ -7,124 +7,72 @@ module OpenAI class Run < OpenAI::BaseModel # The identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The ID of the # [assistant](https://platform.openai.com/docs/api-reference/assistants) used for # execution of this run. sig { returns(String) } - def assistant_id - end - - sig { params(_: String).returns(String) } - def assistant_id=(_) - end + attr_accessor :assistant_id # The Unix timestamp (in seconds) for when the run was cancelled. sig { returns(T.nilable(Integer)) } - def cancelled_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def cancelled_at=(_) - end + attr_accessor :cancelled_at # The Unix timestamp (in seconds) for when the run was completed. sig { returns(T.nilable(Integer)) } - def completed_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def completed_at=(_) - end + attr_accessor :completed_at # The Unix timestamp (in seconds) for when the run was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The Unix timestamp (in seconds) for when the run will expire. sig { returns(T.nilable(Integer)) } - def expires_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def expires_at=(_) - end + attr_accessor :expires_at # The Unix timestamp (in seconds) for when the run failed. sig { returns(T.nilable(Integer)) } - def failed_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def failed_at=(_) - end + attr_accessor :failed_at # Details on why the run is incomplete. Will be `null` if the run is not # incomplete. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Run::IncompleteDetails)) } - def incomplete_details - end + attr_reader :incomplete_details sig do - params(_: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::IncompleteDetails, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::IncompleteDetails, OpenAI::Util::AnyHash))) - end - def incomplete_details=(_) + params( + incomplete_details: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::IncompleteDetails, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :incomplete_details # The instructions that the # [assistant](https://platform.openai.com/docs/api-reference/assistants) used for # this run. sig { returns(String) } - def instructions - end - - sig { params(_: String).returns(String) } - def instructions=(_) - end + attr_accessor :instructions # The last error associated with this run. Will be `null` if there are no errors. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Run::LastError)) } - def last_error - end + attr_reader :last_error sig do - params(_: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::LastError, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::LastError, OpenAI::Util::AnyHash))) - end - def last_error=(_) + params(last_error: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::LastError, OpenAI::Util::AnyHash))) + .void end + attr_writer :last_error # The maximum number of completion tokens specified to have been used over the # course of the run. sig { returns(T.nilable(Integer)) } - def max_completion_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_completion_tokens=(_) - end + attr_accessor :max_completion_tokens # The maximum number of prompt tokens specified to have been used over the course # of the run. sig { returns(T.nilable(Integer)) } - def max_prompt_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_prompt_tokens=(_) - end + attr_accessor :max_prompt_tokens # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -133,56 +81,36 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The model that the # [assistant](https://platform.openai.com/docs/api-reference/assistants) used for # this run. sig { returns(String) } - def model - end - - sig { params(_: String).returns(String) } - def model=(_) - end + attr_accessor :model # The object type, which is always `thread.run`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # Whether to enable # [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) # during tool use. sig { returns(T::Boolean) } - def parallel_tool_calls - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def parallel_tool_calls=(_) - end + attr_accessor :parallel_tool_calls # Details on the action required to continue the run. Will be `null` if no action # is required. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Run::RequiredAction)) } - def required_action - end + attr_reader :required_action sig do - params(_: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::RequiredAction, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::RequiredAction, OpenAI::Util::AnyHash))) - end - def required_action=(_) + params( + required_action: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::RequiredAction, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :required_action # Specifies the format that the model must output. Compatible with # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -216,66 +144,22 @@ module OpenAI ) ) end - def response_format - end - - sig do - params( - _: T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - .returns( - T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - end - def response_format=(_) - end + attr_accessor :response_format # The Unix timestamp (in seconds) for when the run was started. sig { returns(T.nilable(Integer)) } - def started_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def started_at=(_) - end + attr_accessor :started_at # The status of the run, which can be either `queued`, `in_progress`, # `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, # `incomplete`, or `expired`. sig { returns(OpenAI::Models::Beta::Threads::RunStatus::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Beta::Threads::RunStatus::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::RunStatus::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) # that was executed on as a part of this run. sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id # Controls which (if any) tool is called by the model. `none` means the model will # not call any tools and instead generates a message. `auto` is the default value @@ -294,29 +178,7 @@ module OpenAI ) ) end - def tool_choice - end - - sig do - params( - _: T.nilable( - T.any( - OpenAI::Models::Beta::AssistantToolChoiceOption::Auto::TaggedSymbol, - OpenAI::Models::Beta::AssistantToolChoice - ) - ) - ) - .returns( - T.nilable( - T.any( - OpenAI::Models::Beta::AssistantToolChoiceOption::Auto::TaggedSymbol, - OpenAI::Models::Beta::AssistantToolChoice - ) - ) - ) - end - def tool_choice=(_) - end + attr_accessor :tool_choice # The list of tools that the # [assistant](https://platform.openai.com/docs/api-reference/assistants) used for @@ -332,75 +194,36 @@ module OpenAI ] ) end - def tools - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - end - def tools=(_) - end + attr_accessor :tools # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Run::TruncationStrategy)) } - def truncation_strategy - end + attr_reader :truncation_strategy sig do - params(_: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::TruncationStrategy, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::TruncationStrategy, OpenAI::Util::AnyHash))) - end - def truncation_strategy=(_) + params( + truncation_strategy: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::TruncationStrategy, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :truncation_strategy # Usage statistics related to the run. This value will be `null` if the run is not # in a terminal state (i.e. `in_progress`, `queued`, etc.). sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Run::Usage)) } - def usage - end + attr_reader :usage - sig do - params(_: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::Usage, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::Usage, OpenAI::Util::AnyHash))) - end - def usage=(_) - end + sig { params(usage: T.nilable(T.any(OpenAI::Models::Beta::Threads::Run::Usage, OpenAI::Util::AnyHash))).void } + attr_writer :usage # The sampling temperature used for this run. If not set, defaults to 1. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # The nucleus sampling value used for this run. If not set, defaults to 1. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p # Represents an execution run on a # [thread](https://platform.openai.com/docs/api-reference/threads). @@ -547,15 +370,10 @@ module OpenAI # The reason why the run is incomplete. This will point to which specific token # limit was reached over the course of the run. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason::TaggedSymbol)) } - def reason - end + attr_reader :reason - sig do - params(_: OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason::OrSymbol) - end - def reason=(_) - end + sig { params(reason: OpenAI::Models::Beta::Threads::Run::IncompleteDetails::Reason::OrSymbol).void } + attr_writer :reason # Details on why the run is incomplete. Will be `null` if the run is not # incomplete. @@ -596,24 +414,11 @@ module OpenAI class LastError < OpenAI::BaseModel # One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. sig { returns(OpenAI::Models::Beta::Threads::Run::LastError::Code::TaggedSymbol) } - def code - end - - sig do - params(_: OpenAI::Models::Beta::Threads::Run::LastError::Code::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::Run::LastError::Code::TaggedSymbol) - end - def code=(_) - end + attr_accessor :code # A human-readable description of the error. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # The last error associated with this run. Will be `null` if there are no errors. sig do @@ -655,28 +460,19 @@ module OpenAI class RequiredAction < OpenAI::BaseModel # Details on the tool outputs needed for this run to continue. sig { returns(OpenAI::Models::Beta::Threads::Run::RequiredAction::SubmitToolOutputs) } - def submit_tool_outputs - end + attr_reader :submit_tool_outputs sig do params( - _: T.any(OpenAI::Models::Beta::Threads::Run::RequiredAction::SubmitToolOutputs, OpenAI::Util::AnyHash) + submit_tool_outputs: T.any(OpenAI::Models::Beta::Threads::Run::RequiredAction::SubmitToolOutputs, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::Threads::Run::RequiredAction::SubmitToolOutputs, OpenAI::Util::AnyHash) - ) - end - def submit_tool_outputs=(_) + .void end + attr_writer :submit_tool_outputs # For now, this is always `submit_tool_outputs`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Details on the action required to continue the run. Will be `null` if no action # is required. @@ -702,15 +498,7 @@ module OpenAI class SubmitToolOutputs < OpenAI::BaseModel # A list of the relevant tool calls. sig { returns(T::Array[OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall]) } - def tool_calls - end - - sig do - params(_: T::Array[OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall]) - .returns(T::Array[OpenAI::Models::Beta::Threads::RequiredActionFunctionToolCall]) - end - def tool_calls=(_) - end + attr_accessor :tool_calls # Details on the tool outputs needed for this run to continue. sig do @@ -734,25 +522,12 @@ module OpenAI # the thread. When set to `auto`, messages in the middle of the thread will be # dropped to fit the context length of the model, `max_prompt_tokens`. sig { returns(OpenAI::Models::Beta::Threads::Run::TruncationStrategy::Type::TaggedSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::Beta::Threads::Run::TruncationStrategy::Type::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::Run::TruncationStrategy::Type::TaggedSymbol) - end - def type=(_) - end + attr_accessor :type # The number of most recent messages from the thread when constructing the context # for the run. sig { returns(T.nilable(Integer)) } - def last_messages - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def last_messages=(_) - end + attr_accessor :last_messages # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. @@ -805,30 +580,15 @@ module OpenAI class Usage < OpenAI::BaseModel # Number of completion tokens used over the course of the run. sig { returns(Integer) } - def completion_tokens - end - - sig { params(_: Integer).returns(Integer) } - def completion_tokens=(_) - end + attr_accessor :completion_tokens # Number of prompt tokens used over the course of the run. sig { returns(Integer) } - def prompt_tokens - end - - sig { params(_: Integer).returns(Integer) } - def prompt_tokens=(_) - end + attr_accessor :prompt_tokens # Total number of tokens used (prompt + completion). sig { returns(Integer) } - def total_tokens - end - - sig { params(_: Integer).returns(Integer) } - def total_tokens=(_) - end + attr_accessor :total_tokens # Usage statistics related to the run. This value will be `null` if the run is not # in a terminal state (i.e. `in_progress`, `queued`, etc.). diff --git a/rbi/lib/openai/models/beta/threads/run_cancel_params.rbi b/rbi/lib/openai/models/beta/threads/run_cancel_params.rbi index fd833391..d7bb357e 100644 --- a/rbi/lib/openai/models/beta/threads/run_cancel_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_cancel_params.rbi @@ -9,12 +9,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id sig do params(thread_id: String, request_options: T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash)) diff --git a/rbi/lib/openai/models/beta/threads/run_create_params.rbi b/rbi/lib/openai/models/beta/threads/run_create_params.rbi index 49b45721..096ace11 100644 --- a/rbi/lib/openai/models/beta/threads/run_create_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_create_params.rbi @@ -12,12 +12,7 @@ module OpenAI # [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to # execute this run. sig { returns(String) } - def assistant_id - end - - sig { params(_: String).returns(String) } - def assistant_id=(_) - end + attr_accessor :assistant_id # A list of additional fields to include in the response. Currently the only # supported value is `step_details.tool_calls[*].file_search.results[*].content` @@ -27,49 +22,26 @@ module OpenAI # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) # for more information. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol])) } - def include - end + attr_reader :include - sig do - params(_: T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]) - .returns(T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]) - end - def include=(_) - end + sig { params(include: T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]).void } + attr_writer :include # Appends additional instructions at the end of the instructions for the run. This # is useful for modifying the behavior on a per-run basis without overriding other # instructions. sig { returns(T.nilable(String)) } - def additional_instructions - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def additional_instructions=(_) - end + attr_accessor :additional_instructions # Adds additional messages to the thread before creating the run. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage])) } - def additional_messages - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage])) - .returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage])) - end - def additional_messages=(_) - end + attr_accessor :additional_messages # Overrides the # [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) # of the assistant. This is useful for modifying the behavior on a per-run basis. sig { returns(T.nilable(String)) } - def instructions - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def instructions=(_) - end + attr_accessor :instructions # The maximum number of completion tokens that may be used over the course of the # run. The run will make a best effort to use only the number of completion tokens @@ -77,12 +49,7 @@ module OpenAI # completion tokens specified, the run will end with status `incomplete`. See # `incomplete_details` for more info. sig { returns(T.nilable(Integer)) } - def max_completion_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_completion_tokens=(_) - end + attr_accessor :max_completion_tokens # The maximum number of prompt tokens that may be used over the course of the run. # The run will make a best effort to use only the number of prompt tokens @@ -90,12 +57,7 @@ module OpenAI # prompt tokens specified, the run will end with status `incomplete`. See # `incomplete_details` for more info. sig { returns(T.nilable(Integer)) } - def max_prompt_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_prompt_tokens=(_) - end + attr_accessor :max_prompt_tokens # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -104,38 +66,23 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to # be used to execute this run. If a value is provided here, it will override the # model associated with the assistant. If not, the model associated with the # assistant will be used. sig { returns(T.nilable(T.any(String, OpenAI::Models::ChatModel::OrSymbol))) } - def model - end - - sig do - params(_: T.nilable(T.any(String, OpenAI::Models::ChatModel::OrSymbol))) - .returns(T.nilable(T.any(String, OpenAI::Models::ChatModel::OrSymbol))) - end - def model=(_) - end + attr_accessor :model # Whether to enable # [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) # during tool use. sig { returns(T.nilable(T::Boolean)) } - def parallel_tool_calls - end + attr_reader :parallel_tool_calls - sig { params(_: T::Boolean).returns(T::Boolean) } - def parallel_tool_calls=(_) - end + sig { params(parallel_tool_calls: T::Boolean).void } + attr_writer :parallel_tool_calls # **o-series models only** # @@ -144,15 +91,7 @@ module OpenAI # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can # result in faster responses and fewer tokens used on reasoning in a response. sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) } - def reasoning_effort - end - - sig do - params(_: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - end - def reasoning_effort=(_) - end + attr_accessor :reasoning_effort # Specifies the format that the model must output. Compatible with # [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -186,44 +125,13 @@ module OpenAI ) ) end - def response_format - end - - sig do - params( - _: T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - .returns( - T.nilable( - T.any( - Symbol, - OpenAI::Models::ResponseFormatText, - OpenAI::Models::ResponseFormatJSONObject, - OpenAI::Models::ResponseFormatJSONSchema - ) - ) - ) - end - def response_format=(_) - end + attr_accessor :response_format # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more # focused and deterministic. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # Controls which (if any) tool is called by the model. `none` means the model will # not call any tools and instead generates a message. `auto` is the default value @@ -242,29 +150,7 @@ module OpenAI ) ) end - def tool_choice - end - - sig do - params( - _: T.nilable( - T.any( - OpenAI::Models::Beta::AssistantToolChoiceOption::Auto::OrSymbol, - OpenAI::Models::Beta::AssistantToolChoice - ) - ) - ) - .returns( - T.nilable( - T.any( - OpenAI::Models::Beta::AssistantToolChoiceOption::Auto::OrSymbol, - OpenAI::Models::Beta::AssistantToolChoice - ) - ) - ) - end - def tool_choice=(_) - end + attr_accessor :tool_choice # Override the tools the assistant can use for this run. This is useful for # modifying the behavior on a per-run basis. @@ -281,35 +167,7 @@ module OpenAI ) ) end - def tools - end - - sig do - params( - _: T.nilable( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - ) - .returns( - T.nilable( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Models::Beta::FileSearchTool, - OpenAI::Models::Beta::FunctionTool - ) - ] - ) - ) - end - def tools=(_) - end + attr_accessor :tools # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -317,33 +175,22 @@ module OpenAI # # We generally recommend altering this or temperature but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy)) } - def truncation_strategy - end + attr_reader :truncation_strategy sig do params( - _: T.nilable( + truncation_strategy: T.nilable( T.any(OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, OpenAI::Util::AnyHash) ) ) - .returns( - T.nilable( - T.any(OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy, OpenAI::Util::AnyHash) - ) - ) - end - def truncation_strategy=(_) + .void end + attr_writer :truncation_strategy sig do params( @@ -481,37 +328,7 @@ module OpenAI ) ) end - def content - end - - sig do - params( - _: T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlockParam - ) - ] - ) - ) - .returns( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::ImageFileContentBlock, - OpenAI::Models::Beta::Threads::ImageURLContentBlock, - OpenAI::Models::Beta::Threads::TextContentBlockParam - ) - ] - ) - ) - end - def content=(_) - end + attr_accessor :content # The role of the entity that is creating the message. Allowed values include: # @@ -520,15 +337,7 @@ module OpenAI # - `assistant`: Indicates the message is generated by the assistant. Use this # value to insert messages from the assistant into the conversation. sig { returns(OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Role::OrSymbol) } - def role - end - - sig do - params(_: OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Role::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Role::OrSymbol) - end - def role=(_) - end + attr_accessor :role # A list of files attached to the message, and the tools they should be added to. sig do @@ -536,19 +345,7 @@ module OpenAI T.nilable(T::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment]) ) end - def attachments - end - - sig do - params( - _: T.nilable(T::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment]) - ) - .returns( - T.nilable(T::Array[OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment]) - ) - end - def attachments=(_) - end + attr_accessor :attachments # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -557,12 +354,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( @@ -692,12 +484,10 @@ module OpenAI class Attachment < OpenAI::BaseModel # The ID of the file to attach to the message. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The tools to add this file to. sig do @@ -712,12 +502,11 @@ module OpenAI ) ) end - def tools - end + attr_reader :tools sig do params( - _: T::Array[ + tools: T::Array[ T.any( OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Util::AnyHash, @@ -725,18 +514,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::CodeInterpreterTool, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::Threads::RunCreateParams::AdditionalMessage::Attachment::Tool::FileSearch - ) - ] - ) - end - def tools=(_) + .void end + attr_writer :tools sig do params( @@ -787,12 +567,7 @@ module OpenAI class FileSearch < OpenAI::BaseModel # The type of tool being defined: `file_search` sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { params(type: Symbol).returns(T.attached_class) } def self.new(type: :file_search) @@ -839,25 +614,12 @@ module OpenAI # the thread. When set to `auto`, messages in the middle of the thread will be # dropped to fit the context length of the model, `max_prompt_tokens`. sig { returns(OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy::Type::OrSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy::Type::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::RunCreateParams::TruncationStrategy::Type::OrSymbol) - end - def type=(_) - end + attr_accessor :type # The number of most recent messages from the thread when constructing the context # for the run. sig { returns(T.nilable(Integer)) } - def last_messages - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def last_messages=(_) - end + attr_accessor :last_messages # Controls for how a thread will be truncated prior to the run. Use this to # control the intial context window of the run. diff --git a/rbi/lib/openai/models/beta/threads/run_list_params.rbi b/rbi/lib/openai/models/beta/threads/run_list_params.rbi index 8021be63..54ec8f4c 100644 --- a/rbi/lib/openai/models/beta/threads/run_list_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_list_params.rbi @@ -13,47 +13,36 @@ module OpenAI # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A cursor for use in pagination. `before` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # starting with obj_foo, your subsequent call can include before=obj_foo in order # to fetch the previous page of the list. sig { returns(T.nilable(String)) } - def before - end + attr_reader :before - sig { params(_: String).returns(String) } - def before=(_) - end + sig { params(before: String).void } + attr_writer :before # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order by the `created_at` timestamp of the objects. `asc` for ascending # order and `desc` for descending order. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::RunListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::Beta::Threads::RunListParams::Order::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::RunListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::Beta::Threads::RunListParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/beta/threads/run_retrieve_params.rbi b/rbi/lib/openai/models/beta/threads/run_retrieve_params.rbi index 90546b16..56e89445 100644 --- a/rbi/lib/openai/models/beta/threads/run_retrieve_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_retrieve_params.rbi @@ -9,12 +9,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id sig do params(thread_id: String, request_options: T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash)) diff --git a/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi b/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi index aad29cff..48f5b347 100644 --- a/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rbi @@ -9,24 +9,11 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id # A list of tools for which the outputs are being submitted. sig { returns(T::Array[OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput]) } - def tool_outputs - end - - sig do - params(_: T::Array[OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput]) - .returns(T::Array[OpenAI::Models::Beta::Threads::RunSubmitToolOutputsParams::ToolOutput]) - end - def tool_outputs=(_) - end + attr_accessor :tool_outputs sig do params( @@ -55,22 +42,18 @@ module OpenAI class ToolOutput < OpenAI::BaseModel # The output of the tool call to be submitted to continue the run. sig { returns(T.nilable(String)) } - def output - end + attr_reader :output - sig { params(_: String).returns(String) } - def output=(_) - end + sig { params(output: String).void } + attr_writer :output # The ID of the tool call in the `required_action` object within the run object # the output is being submitted for. sig { returns(T.nilable(String)) } - def tool_call_id - end + attr_reader :tool_call_id - sig { params(_: String).returns(String) } - def tool_call_id=(_) - end + sig { params(tool_call_id: String).void } + attr_writer :tool_call_id sig { params(output: String, tool_call_id: String).returns(T.attached_class) } def self.new(output: nil, tool_call_id: nil) diff --git a/rbi/lib/openai/models/beta/threads/run_update_params.rbi b/rbi/lib/openai/models/beta/threads/run_update_params.rbi index 41fc9c62..65bfc898 100644 --- a/rbi/lib/openai/models/beta/threads/run_update_params.rbi +++ b/rbi/lib/openai/models/beta/threads/run_update_params.rbi @@ -9,12 +9,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -23,12 +18,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi index a6c26d19..76b660b5 100644 --- a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_logs.rbi @@ -8,30 +8,18 @@ module OpenAI class CodeInterpreterLogs < OpenAI::BaseModel # The index of the output in the outputs array. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Always `logs`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The text output from the Code Interpreter tool call. sig { returns(T.nilable(String)) } - def logs - end + attr_reader :logs - sig { params(_: String).returns(String) } - def logs=(_) - end + sig { params(logs: String).void } + attr_writer :logs # Text output from the Code Interpreter tool call as part of a run step. sig { params(index: Integer, logs: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi index 97783911..3d0e6331 100644 --- a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_output_image.rbi @@ -8,36 +8,22 @@ module OpenAI class CodeInterpreterOutputImage < OpenAI::BaseModel # The index of the output in the outputs array. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Always `image`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage::Image)) } - def image - end + attr_reader :image sig do params( - _: T.any(OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage::Image, OpenAI::Util::AnyHash) + image: T.any(OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage::Image, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage::Image, OpenAI::Util::AnyHash) - ) - end - def image=(_) + .void end + attr_writer :image sig do params( @@ -63,12 +49,10 @@ module OpenAI # The [file](https://platform.openai.com/docs/api-reference/files) ID of the # image. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id sig { params(file_id: String).returns(T.attached_class) } def self.new(file_id: nil) diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi index 7dcb0cba..8d3d6522 100644 --- a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rbi @@ -8,44 +8,27 @@ module OpenAI class CodeInterpreterToolCall < OpenAI::BaseModel # The ID of the tool call. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Code Interpreter tool call definition. sig { returns(OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter) } - def code_interpreter - end + attr_reader :code_interpreter sig do params( - _: T.any( + code_interpreter: T.any( OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter, - OpenAI::Util::AnyHash - ) - ) - end - def code_interpreter=(_) + .void end + attr_writer :code_interpreter # The type of tool call. This is always going to be `code_interpreter` for this # type of tool call. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Details of the Code Interpreter tool call the run step was involved in. sig do @@ -78,12 +61,7 @@ module OpenAI class CodeInterpreter < OpenAI::BaseModel # The input to the Code Interpreter tool call. sig { returns(String) } - def input - end - - sig { params(_: String).returns(String) } - def input=(_) - end + attr_accessor :input # The outputs from the Code Interpreter tool call. Code Interpreter can output one # or more items, including text (`logs`) or images (`image`). Each of these are @@ -98,29 +76,7 @@ module OpenAI ] ) end - def outputs - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Logs, - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Image - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Logs, - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Image - ) - ] - ) - end - def outputs=(_) - end + attr_accessor :outputs # The Code Interpreter tool call definition. sig do @@ -173,21 +129,11 @@ module OpenAI class Logs < OpenAI::BaseModel # The text output from the Code Interpreter tool call. sig { returns(String) } - def logs - end - - sig { params(_: String).returns(String) } - def logs=(_) - end + attr_accessor :logs # Always `logs`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Text output from the Code Interpreter tool call as part of a run step. sig { params(logs: String, type: Symbol).returns(T.attached_class) } @@ -205,34 +151,22 @@ module OpenAI OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Image::Image ) end - def image - end + attr_reader :image sig do params( - _: T.any( + image: T.any( OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Image::Image, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall::CodeInterpreter::Output::Image::Image, - OpenAI::Util::AnyHash - ) - ) - end - def image=(_) + .void end + attr_writer :image # Always `image`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params( @@ -263,12 +197,7 @@ module OpenAI # The [file](https://platform.openai.com/docs/api-reference/files) ID of the # image. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id sig { params(file_id: String).returns(T.attached_class) } def self.new(file_id:) diff --git a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi index 244ab852..f8b5b1e9 100644 --- a/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rbi @@ -8,53 +8,34 @@ module OpenAI class CodeInterpreterToolCallDelta < OpenAI::BaseModel # The index of the tool call in the tool calls array. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The type of tool call. This is always going to be `code_interpreter` for this # type of tool call. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The ID of the tool call. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id # The Code Interpreter tool call definition. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta::CodeInterpreter)) } - def code_interpreter - end + attr_reader :code_interpreter sig do params( - _: T.any( + code_interpreter: T.any( OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta::CodeInterpreter, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta::CodeInterpreter, - OpenAI::Util::AnyHash - ) - ) - end - def code_interpreter=(_) + .void end + attr_writer :code_interpreter # Details of the Code Interpreter tool call the run step was involved in. sig do @@ -89,12 +70,10 @@ module OpenAI class CodeInterpreter < OpenAI::BaseModel # The input to the Code Interpreter tool call. sig { returns(T.nilable(String)) } - def input - end + attr_reader :input - sig { params(_: String).returns(String) } - def input=(_) - end + sig { params(input: String).void } + attr_writer :input # The outputs from the Code Interpreter tool call. Code Interpreter can output one # or more items, including text (`logs`) or images (`image`). Each of these are @@ -111,12 +90,11 @@ module OpenAI ) ) end - def outputs - end + attr_reader :outputs sig do params( - _: T::Array[ + outputs: T::Array[ T.any( OpenAI::Models::Beta::Threads::Runs::CodeInterpreterLogs, OpenAI::Util::AnyHash, @@ -124,18 +102,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterLogs, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterOutputImage - ) - ] - ) - end - def outputs=(_) + .void end + attr_writer :outputs # The Code Interpreter tool call definition. sig do diff --git a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi b/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi index ae88c21f..4b92c053 100644 --- a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call.rbi @@ -8,36 +8,24 @@ module OpenAI class FileSearchToolCall < OpenAI::BaseModel # The ID of the tool call object. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # For now, this is always going to be an empty object. sig { returns(OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch) } - def file_search - end + attr_reader :file_search sig do params( - _: T.any(OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch, OpenAI::Util::AnyHash) + file_search: T.any(OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch, OpenAI::Util::AnyHash) ) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch, OpenAI::Util::AnyHash)) - end - def file_search=(_) + .void end + attr_writer :file_search # The type of tool call. This is always going to be `file_search` for this type of # tool call. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params( @@ -62,41 +50,30 @@ module OpenAI class FileSearch < OpenAI::BaseModel # The ranking options for the file search. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions)) } - def ranking_options - end + attr_reader :ranking_options sig do params( - _: T.any( + ranking_options: T.any( OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions, - OpenAI::Util::AnyHash - ) - ) - end - def ranking_options=(_) + .void end + attr_writer :ranking_options # The results of the file search. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result])) } - def results - end + attr_reader :results sig do params( - _: T::Array[T.any(OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result, OpenAI::Util::AnyHash)] + results: T::Array[T.any(OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result, OpenAI::Util::AnyHash)] ) - .returns( - T::Array[T.any(OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result, OpenAI::Util::AnyHash)] - ) - end - def results=(_) + .void end + attr_writer :results # For now, this is always going to be an empty object. sig do @@ -132,29 +109,12 @@ module OpenAI OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions::Ranker::TaggedSymbol ) end - def ranker - end - - sig do - params( - _: OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions::Ranker::TaggedSymbol - ) - .returns( - OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::RankingOptions::Ranker::TaggedSymbol - ) - end - def ranker=(_) - end + attr_accessor :ranker # The score threshold for the file search. All values must be a floating point # number between 0 and 1. sig { returns(Float) } - def score_threshold - end - - sig { params(_: Float).returns(Float) } - def score_threshold=(_) - end + attr_accessor :score_threshold # The ranking options for the file search. sig do @@ -221,31 +181,16 @@ module OpenAI class Result < OpenAI::BaseModel # The ID of the file that result was found in. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # The name of the file that result was found in. sig { returns(String) } - def file_name - end - - sig { params(_: String).returns(String) } - def file_name=(_) - end + attr_accessor :file_name # The score of the result. All values must be a floating point number between 0 # and 1. sig { returns(Float) } - def score - end - - sig { params(_: Float).returns(Float) } - def score=(_) - end + attr_accessor :score # The content of the result that was found. The content is only included if # requested via the include query parameter. @@ -254,29 +199,20 @@ module OpenAI T.nilable(T::Array[OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content]) ) end - def content - end + attr_reader :content sig do params( - _: T::Array[ + content: T::Array[ T.any( OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content, OpenAI::Util::AnyHash ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content, - OpenAI::Util::AnyHash - ) - ] - ) - end - def content=(_) + .void end + attr_writer :content # A result instance of the file search. sig do @@ -313,12 +249,10 @@ module OpenAI class Content < OpenAI::BaseModel # The text content of the file. sig { returns(T.nilable(String)) } - def text - end + attr_reader :text - sig { params(_: String).returns(String) } - def text=(_) - end + sig { params(text: String).void } + attr_writer :text # The type of the content. sig do @@ -328,19 +262,15 @@ module OpenAI ) ) end - def type - end + attr_reader :type sig do params( - _: OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content::Type::OrSymbol + type: OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content::Type::OrSymbol ) - .returns( - OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall::FileSearch::Result::Content::Type::OrSymbol - ) - end - def type=(_) + .void end + attr_writer :type sig do params( diff --git a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi index 4986a86f..8dda0ce6 100644 --- a/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/file_search_tool_call_delta.rbi @@ -8,40 +8,23 @@ module OpenAI class FileSearchToolCallDelta < OpenAI::BaseModel # For now, this is always going to be an empty object. sig { returns(T.anything) } - def file_search - end - - sig { params(_: T.anything).returns(T.anything) } - def file_search=(_) - end + attr_accessor :file_search # The index of the tool call in the tool calls array. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The type of tool call. This is always going to be `file_search` for this type of # tool call. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The ID of the tool call object. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id sig do params( diff --git a/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi b/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi index 4c691bf9..3e337e83 100644 --- a/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/function_tool_call.rbi @@ -8,34 +8,24 @@ module OpenAI class FunctionToolCall < OpenAI::BaseModel # The ID of the tool call object. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The definition of the function that was called. sig { returns(OpenAI::Models::Beta::Threads::Runs::FunctionToolCall::Function) } - def function - end + attr_reader :function sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::FunctionToolCall::Function, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::FunctionToolCall::Function, OpenAI::Util::AnyHash)) - end - def function=(_) + params( + function: T.any(OpenAI::Models::Beta::Threads::Runs::FunctionToolCall::Function, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :function # The type of tool call. This is always going to be `function` for this type of # tool call. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params( @@ -60,32 +50,17 @@ module OpenAI class Function < OpenAI::BaseModel # The arguments passed to the function. sig { returns(String) } - def arguments - end - - sig { params(_: String).returns(String) } - def arguments=(_) - end + attr_accessor :arguments # The name of the function. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # The output of the function. This will be `null` if the outputs have not been # [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) # yet. sig { returns(T.nilable(String)) } - def output - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def output=(_) - end + attr_accessor :output # The definition of the function that was called. sig do diff --git a/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi index 8819f4f0..04b5a69e 100644 --- a/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/function_tool_call_delta.rbi @@ -8,47 +8,31 @@ module OpenAI class FunctionToolCallDelta < OpenAI::BaseModel # The index of the tool call in the tool calls array. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The type of tool call. This is always going to be `function` for this type of # tool call. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The ID of the tool call object. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id # The definition of the function that was called. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta::Function)) } - def function - end + attr_reader :function sig do params( - _: T.any(OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta::Function, OpenAI::Util::AnyHash) + function: T.any(OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta::Function, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta::Function, OpenAI::Util::AnyHash) - ) - end - def function=(_) + .void end + attr_writer :function sig do params( @@ -79,32 +63,23 @@ module OpenAI class Function < OpenAI::BaseModel # The arguments passed to the function. sig { returns(T.nilable(String)) } - def arguments - end + attr_reader :arguments - sig { params(_: String).returns(String) } - def arguments=(_) - end + sig { params(arguments: String).void } + attr_writer :arguments # The name of the function. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name # The output of the function. This will be `null` if the outputs have not been # [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) # yet. sig { returns(T.nilable(String)) } - def output - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def output=(_) - end + attr_accessor :output # The definition of the function that was called. sig do diff --git a/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi b/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi index 6c36a326..8a929854 100644 --- a/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/message_creation_step_details.rbi @@ -7,34 +7,22 @@ module OpenAI module Runs class MessageCreationStepDetails < OpenAI::BaseModel sig { returns(OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails::MessageCreation) } - def message_creation - end + attr_reader :message_creation sig do params( - _: T.any( + message_creation: T.any( OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails::MessageCreation, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails::MessageCreation, - OpenAI::Util::AnyHash - ) - ) - end - def message_creation=(_) + .void end + attr_writer :message_creation # Always `message_creation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Details of the message creation by the run step. sig do @@ -65,12 +53,7 @@ module OpenAI class MessageCreation < OpenAI::BaseModel # The ID of the message that was created by this run step. sig { returns(String) } - def message_id - end - - sig { params(_: String).returns(String) } - def message_id=(_) - end + attr_accessor :message_id sig { params(message_id: String).returns(T.attached_class) } def self.new(message_id:) diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step.rbi b/rbi/lib/openai/models/beta/threads/runs/run_step.rbi index c2d4d482..03af7f5d 100644 --- a/rbi/lib/openai/models/beta/threads/runs/run_step.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/run_step.rbi @@ -8,84 +8,47 @@ module OpenAI class RunStep < OpenAI::BaseModel # The identifier of the run step, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The ID of the # [assistant](https://platform.openai.com/docs/api-reference/assistants) # associated with the run step. sig { returns(String) } - def assistant_id - end - - sig { params(_: String).returns(String) } - def assistant_id=(_) - end + attr_accessor :assistant_id # The Unix timestamp (in seconds) for when the run step was cancelled. sig { returns(T.nilable(Integer)) } - def cancelled_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def cancelled_at=(_) - end + attr_accessor :cancelled_at # The Unix timestamp (in seconds) for when the run step completed. sig { returns(T.nilable(Integer)) } - def completed_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def completed_at=(_) - end + attr_accessor :completed_at # The Unix timestamp (in seconds) for when the run step was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The Unix timestamp (in seconds) for when the run step expired. A step is # considered expired if the parent run is expired. sig { returns(T.nilable(Integer)) } - def expired_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def expired_at=(_) - end + attr_accessor :expired_at # The Unix timestamp (in seconds) for when the run step failed. sig { returns(T.nilable(Integer)) } - def failed_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def failed_at=(_) - end + attr_accessor :failed_at # The last error associated with this run step. Will be `null` if there are no # errors. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Runs::RunStep::LastError)) } - def last_error - end + attr_reader :last_error sig do params( - _: T.nilable(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep::LastError, OpenAI::Util::AnyHash)) + last_error: T.nilable(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep::LastError, OpenAI::Util::AnyHash)) ) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep::LastError, OpenAI::Util::AnyHash))) - end - def last_error=(_) + .void end + attr_writer :last_error # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -94,44 +57,21 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The object type, which is always `thread.run.step`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that # this run step is a part of. sig { returns(String) } - def run_id - end - - sig { params(_: String).returns(String) } - def run_id=(_) - end + attr_accessor :run_id # The status of the run step, which can be either `in_progress`, `cancelled`, # `failed`, `completed`, or `expired`. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Beta::Threads::Runs::RunStep::Status::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::Runs::RunStep::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The details of the run step. sig do @@ -142,60 +82,29 @@ module OpenAI ) ) end - def step_details - end - - sig do - params( - _: T.any( - OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails, - OpenAI::Models::Beta::Threads::Runs::ToolCallsStepDetails - ) - ) - .returns( - T.any( - OpenAI::Models::Beta::Threads::Runs::MessageCreationStepDetails, - OpenAI::Models::Beta::Threads::Runs::ToolCallsStepDetails - ) - ) - end - def step_details=(_) - end + attr_accessor :step_details # The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) # that was run. sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id # The type of run step, which can be either `message_creation` or `tool_calls`. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep::Type::TaggedSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::Beta::Threads::Runs::RunStep::Type::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::Runs::RunStep::Type::TaggedSymbol) - end - def type=(_) - end + attr_accessor :type # Usage statistics related to the run step. This value will be `null` while the # run step's status is `in_progress`. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Runs::RunStep::Usage)) } - def usage - end + attr_reader :usage sig do - params(_: T.nilable(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep::Usage, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep::Usage, OpenAI::Util::AnyHash))) - end - def usage=(_) + params( + usage: T.nilable(T.any(OpenAI::Models::Beta::Threads::Runs::RunStep::Usage, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :usage # Represents a step in execution of a run. sig do @@ -275,24 +184,11 @@ module OpenAI class LastError < OpenAI::BaseModel # One of `server_error` or `rate_limit_exceeded`. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStep::LastError::Code::TaggedSymbol) } - def code - end - - sig do - params(_: OpenAI::Models::Beta::Threads::Runs::RunStep::LastError::Code::TaggedSymbol) - .returns(OpenAI::Models::Beta::Threads::Runs::RunStep::LastError::Code::TaggedSymbol) - end - def code=(_) - end + attr_accessor :code # A human-readable description of the error. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # The last error associated with this run step. Will be `null` if there are no # errors. @@ -404,30 +300,15 @@ module OpenAI class Usage < OpenAI::BaseModel # Number of completion tokens used over the course of the run step. sig { returns(Integer) } - def completion_tokens - end - - sig { params(_: Integer).returns(Integer) } - def completion_tokens=(_) - end + attr_accessor :completion_tokens # Number of prompt tokens used over the course of the run step. sig { returns(Integer) } - def prompt_tokens - end - - sig { params(_: Integer).returns(Integer) } - def prompt_tokens=(_) - end + attr_accessor :prompt_tokens # Total number of tokens used (prompt + completion). sig { returns(Integer) } - def total_tokens - end - - sig { params(_: Integer).returns(Integer) } - def total_tokens=(_) - end + attr_accessor :total_tokens # Usage statistics related to the run step. This value will be `null` while the # run step's status is `in_progress`. diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi index c291b78b..ecd4fba6 100644 --- a/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/run_step_delta.rbi @@ -17,27 +17,19 @@ module OpenAI ) ) end - def step_details - end + attr_reader :step_details sig do params( - _: T.any( + step_details: T.any( OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta, OpenAI::Util::AnyHash, OpenAI::Models::Beta::Threads::Runs::ToolCallDeltaObject ) ) - .returns( - T.any( - OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::Threads::Runs::ToolCallDeltaObject - ) - ) - end - def step_details=(_) + .void end + attr_writer :step_details # The delta containing the fields that have changed on the run step. sig do diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi b/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi index bd418312..08c7adf8 100644 --- a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/run_step_delta_event.rbi @@ -8,33 +8,18 @@ module OpenAI class RunStepDeltaEvent < OpenAI::BaseModel # The identifier of the run step, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The delta containing the fields that have changed on the run step. sig { returns(OpenAI::Models::Beta::Threads::Runs::RunStepDelta) } - def delta - end + attr_reader :delta - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDelta, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDelta, OpenAI::Util::AnyHash)) - end - def delta=(_) - end + sig { params(delta: T.any(OpenAI::Models::Beta::Threads::Runs::RunStepDelta, OpenAI::Util::AnyHash)).void } + attr_writer :delta # The object type, which is always `thread.run.step.delta`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # Represents a run step delta i.e. any changed fields on a run step during # streaming. diff --git a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi b/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi index 3df236cc..a13b01a2 100644 --- a/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rbi @@ -8,33 +8,21 @@ module OpenAI class RunStepDeltaMessageDelta < OpenAI::BaseModel # Always `message_creation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta::MessageCreation)) } - def message_creation - end + attr_reader :message_creation sig do params( - _: T.any( + message_creation: T.any( OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta::MessageCreation, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Beta::Threads::Runs::RunStepDeltaMessageDelta::MessageCreation, - OpenAI::Util::AnyHash - ) - ) - end - def message_creation=(_) + .void end + attr_writer :message_creation # Details of the message creation by the run step. sig do @@ -65,12 +53,10 @@ module OpenAI class MessageCreation < OpenAI::BaseModel # The ID of the message that was created by this run step. sig { returns(T.nilable(String)) } - def message_id - end + attr_reader :message_id - sig { params(_: String).returns(String) } - def message_id=(_) - end + sig { params(message_id: String).void } + attr_writer :message_id sig { params(message_id: String).returns(T.attached_class) } def self.new(message_id: nil) diff --git a/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi b/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi index fefcb8ac..be9ab4d9 100644 --- a/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/step_list_params.rbi @@ -10,36 +10,27 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id # A cursor for use in pagination. `after` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A cursor for use in pagination. `before` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # starting with obj_foo, your subsequent call can include before=obj_foo in order # to fetch the previous page of the list. sig { returns(T.nilable(String)) } - def before - end + attr_reader :before - sig { params(_: String).returns(String) } - def before=(_) - end + sig { params(before: String).void } + attr_writer :before # A list of additional fields to include in the response. Currently the only # supported value is `step_details.tool_calls[*].file_search.results[*].content` @@ -49,38 +40,26 @@ module OpenAI # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) # for more information. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol])) } - def include - end + attr_reader :include - sig do - params(_: T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]) - .returns(T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]) - end - def include=(_) - end + sig { params(include: T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]).void } + attr_writer :include # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order by the `created_at` timestamp of the objects. `asc` for ascending # order and `desc` for descending order. sig { returns(T.nilable(OpenAI::Models::Beta::Threads::Runs::StepListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::Beta::Threads::Runs::StepListParams::Order::OrSymbol) - .returns(OpenAI::Models::Beta::Threads::Runs::StepListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::Beta::Threads::Runs::StepListParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi b/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi index 42271a87..c65e2b00 100644 --- a/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/step_retrieve_params.rbi @@ -10,20 +10,10 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def thread_id - end - - sig { params(_: String).returns(String) } - def thread_id=(_) - end + attr_accessor :thread_id sig { returns(String) } - def run_id - end - - sig { params(_: String).returns(String) } - def run_id=(_) - end + attr_accessor :run_id # A list of additional fields to include in the response. Currently the only # supported value is `step_details.tool_calls[*].file_search.results[*].content` @@ -33,15 +23,10 @@ module OpenAI # [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) # for more information. sig { returns(T.nilable(T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol])) } - def include - end + attr_reader :include - sig do - params(_: T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]) - .returns(T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]) - end - def include=(_) - end + sig { params(include: T::Array[OpenAI::Models::Beta::Threads::Runs::RunStepInclude::OrSymbol]).void } + attr_writer :include sig do params( diff --git a/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi b/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi index 17d54160..c4833e7c 100644 --- a/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/tool_call_delta_object.rbi @@ -8,12 +8,7 @@ module OpenAI class ToolCallDeltaObject < OpenAI::BaseModel # Always `tool_calls`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An array of tool calls the run step was involved in. These can be associated # with one of three types of tools: `code_interpreter`, `file_search`, or @@ -31,12 +26,11 @@ module OpenAI ) ) end - def tool_calls - end + attr_reader :tool_calls sig do params( - _: T::Array[ + tool_calls: T::Array[ T.any( OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta, OpenAI::Util::AnyHash, @@ -45,19 +39,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCallDelta, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::Threads::Runs::FileSearchToolCallDelta, - OpenAI::Models::Beta::Threads::Runs::FunctionToolCallDelta - ) - ] - ) - end - def tool_calls=(_) + .void end + attr_writer :tool_calls # Details of the tool call. sig do diff --git a/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi b/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi index d244c946..0dade5cb 100644 --- a/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi +++ b/rbi/lib/openai/models/beta/threads/runs/tool_calls_step_details.rbi @@ -20,40 +20,11 @@ module OpenAI ] ) end - def tool_calls - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall, - OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall, - OpenAI::Models::Beta::Threads::Runs::FunctionToolCall - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::Runs::CodeInterpreterToolCall, - OpenAI::Models::Beta::Threads::Runs::FileSearchToolCall, - OpenAI::Models::Beta::Threads::Runs::FunctionToolCall - ) - ] - ) - end - def tool_calls=(_) - end + attr_accessor :tool_calls # Always `tool_calls`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Details of the tool call. sig do diff --git a/rbi/lib/openai/models/beta/threads/text.rbi b/rbi/lib/openai/models/beta/threads/text.rbi index eda70b49..9dd44292 100644 --- a/rbi/lib/openai/models/beta/threads/text.rbi +++ b/rbi/lib/openai/models/beta/threads/text.rbi @@ -15,38 +15,11 @@ module OpenAI ] ) end - def annotations - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Beta::Threads::FileCitationAnnotation, - OpenAI::Models::Beta::Threads::FilePathAnnotation - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::FileCitationAnnotation, - OpenAI::Models::Beta::Threads::FilePathAnnotation - ) - ] - ) - end - def annotations=(_) - end + attr_accessor :annotations # The data that makes up the text. sig { returns(String) } - def value - end - - sig { params(_: String).returns(String) } - def value=(_) - end + attr_accessor :value sig do params( diff --git a/rbi/lib/openai/models/beta/threads/text_content_block.rbi b/rbi/lib/openai/models/beta/threads/text_content_block.rbi index 2ba0d542..18c16ea3 100644 --- a/rbi/lib/openai/models/beta/threads/text_content_block.rbi +++ b/rbi/lib/openai/models/beta/threads/text_content_block.rbi @@ -6,24 +6,14 @@ module OpenAI module Threads class TextContentBlock < OpenAI::BaseModel sig { returns(OpenAI::Models::Beta::Threads::Text) } - def text - end + attr_reader :text - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::Text, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::Text, OpenAI::Util::AnyHash)) - end - def text=(_) - end + sig { params(text: T.any(OpenAI::Models::Beta::Threads::Text, OpenAI::Util::AnyHash)).void } + attr_writer :text # Always `text`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The text content that is part of a message. sig do diff --git a/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi b/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi index 58764a6f..f59cbbd5 100644 --- a/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi +++ b/rbi/lib/openai/models/beta/threads/text_content_block_param.rbi @@ -7,21 +7,11 @@ module OpenAI class TextContentBlockParam < OpenAI::BaseModel # Text content to be sent to the model sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # Always `text`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The text content that is part of a message. sig { params(text: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/beta/threads/text_delta.rbi b/rbi/lib/openai/models/beta/threads/text_delta.rbi index d7051ba2..2f225af3 100644 --- a/rbi/lib/openai/models/beta/threads/text_delta.rbi +++ b/rbi/lib/openai/models/beta/threads/text_delta.rbi @@ -17,12 +17,11 @@ module OpenAI ) ) end - def annotations - end + attr_reader :annotations sig do params( - _: T::Array[ + annotations: T::Array[ T.any( OpenAI::Models::Beta::Threads::FileCitationDeltaAnnotation, OpenAI::Util::AnyHash, @@ -30,27 +29,16 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Beta::Threads::FileCitationDeltaAnnotation, - OpenAI::Util::AnyHash, - OpenAI::Models::Beta::Threads::FilePathDeltaAnnotation - ) - ] - ) - end - def annotations=(_) + .void end + attr_writer :annotations # The data that makes up the text. sig { returns(T.nilable(String)) } - def value - end + attr_reader :value - sig { params(_: String).returns(String) } - def value=(_) - end + sig { params(value: String).void } + attr_writer :value sig do params( diff --git a/rbi/lib/openai/models/beta/threads/text_delta_block.rbi b/rbi/lib/openai/models/beta/threads/text_delta_block.rbi index b694fadd..0e37546f 100644 --- a/rbi/lib/openai/models/beta/threads/text_delta_block.rbi +++ b/rbi/lib/openai/models/beta/threads/text_delta_block.rbi @@ -7,32 +7,17 @@ module OpenAI class TextDeltaBlock < OpenAI::BaseModel # The index of the content part in the message. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Always `text`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { returns(T.nilable(OpenAI::Models::Beta::Threads::TextDelta)) } - def text - end + attr_reader :text - sig do - params(_: T.any(OpenAI::Models::Beta::Threads::TextDelta, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Beta::Threads::TextDelta, OpenAI::Util::AnyHash)) - end - def text=(_) - end + sig { params(text: T.any(OpenAI::Models::Beta::Threads::TextDelta, OpenAI::Util::AnyHash)).void } + attr_writer :text # The text content that is part of a message. sig do diff --git a/rbi/lib/openai/models/chat/chat_completion.rbi b/rbi/lib/openai/models/chat/chat_completion.rbi index 45ff9cca..f48fc10a 100644 --- a/rbi/lib/openai/models/chat/chat_completion.rbi +++ b/rbi/lib/openai/models/chat/chat_completion.rbi @@ -6,88 +6,45 @@ module OpenAI class ChatCompletion < OpenAI::BaseModel # A unique identifier for the chat completion. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # A list of chat completion choices. Can be more than one if `n` is greater # than 1. sig { returns(T::Array[OpenAI::Models::Chat::ChatCompletion::Choice]) } - def choices - end - - sig do - params(_: T::Array[OpenAI::Models::Chat::ChatCompletion::Choice]) - .returns(T::Array[OpenAI::Models::Chat::ChatCompletion::Choice]) - end - def choices=(_) - end + attr_accessor :choices # The Unix timestamp (in seconds) of when the chat completion was created. sig { returns(Integer) } - def created - end - - sig { params(_: Integer).returns(Integer) } - def created=(_) - end + attr_accessor :created # The model used for the chat completion. sig { returns(String) } - def model - end - - sig { params(_: String).returns(String) } - def model=(_) - end + attr_accessor :model # The object type, which is always `chat.completion`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The service tier used for processing the request. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletion::ServiceTier::TaggedSymbol)) } - def service_tier - end - - sig do - params(_: T.nilable(OpenAI::Models::Chat::ChatCompletion::ServiceTier::TaggedSymbol)) - .returns(T.nilable(OpenAI::Models::Chat::ChatCompletion::ServiceTier::TaggedSymbol)) - end - def service_tier=(_) - end + attr_accessor :service_tier # This fingerprint represents the backend configuration that the model runs with. # # Can be used in conjunction with the `seed` request parameter to understand when # backend changes have been made that might impact determinism. sig { returns(T.nilable(String)) } - def system_fingerprint - end + attr_reader :system_fingerprint - sig { params(_: String).returns(String) } - def system_fingerprint=(_) - end + sig { params(system_fingerprint: String).void } + attr_writer :system_fingerprint # Usage statistics for the completion request. sig { returns(T.nilable(OpenAI::Models::CompletionUsage)) } - def usage - end + attr_reader :usage - sig do - params(_: T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash)) - end - def usage=(_) - end + sig { params(usage: T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash)).void } + attr_writer :usage # Represents a chat completion response returned by model, based on the provided # input. @@ -142,48 +99,30 @@ module OpenAI # model called a tool, or `function_call` (deprecated) if the model called a # function. sig { returns(OpenAI::Models::Chat::ChatCompletion::Choice::FinishReason::TaggedSymbol) } - def finish_reason - end - - sig do - params(_: OpenAI::Models::Chat::ChatCompletion::Choice::FinishReason::TaggedSymbol) - .returns(OpenAI::Models::Chat::ChatCompletion::Choice::FinishReason::TaggedSymbol) - end - def finish_reason=(_) - end + attr_accessor :finish_reason # The index of the choice in the list of choices. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Log probability information for the choice. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletion::Choice::Logprobs)) } - def logprobs - end + attr_reader :logprobs sig do - params(_: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletion::Choice::Logprobs, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Chat::ChatCompletion::Choice::Logprobs, OpenAI::Util::AnyHash))) - end - def logprobs=(_) + params( + logprobs: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletion::Choice::Logprobs, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :logprobs # A chat completion message generated by the model. sig { returns(OpenAI::Models::Chat::ChatCompletionMessage) } - def message - end + attr_reader :message - sig do - params(_: T.any(OpenAI::Models::Chat::ChatCompletionMessage, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Chat::ChatCompletionMessage, OpenAI::Util::AnyHash)) - end - def message=(_) - end + sig { params(message: T.any(OpenAI::Models::Chat::ChatCompletionMessage, OpenAI::Util::AnyHash)).void } + attr_writer :message sig do params( @@ -242,27 +181,11 @@ module OpenAI class Logprobs < OpenAI::BaseModel # A list of message content tokens with log probability information. sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) } - def content - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) - .returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) - end - def content=(_) - end + attr_accessor :content # A list of message refusal tokens with log probability information. sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) } - def refusal - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) - .returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) - end - def refusal=(_) - end + attr_accessor :refusal # Log probability information for the choice. sig do diff --git a/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi index 260791cc..c36302c3 100644 --- a/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_assistant_message_param.rbi @@ -6,29 +6,20 @@ module OpenAI class ChatCompletionAssistantMessageParam < OpenAI::BaseModel # The role of the messages author, in this case `assistant`. sig { returns(Symbol) } - def role - end - - sig { params(_: Symbol).returns(Symbol) } - def role=(_) - end + attr_accessor :role # Data about a previous audio response from the model. # [Learn more](https://platform.openai.com/docs/guides/audio). sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Audio)) } - def audio - end + attr_reader :audio sig do params( - _: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Audio, OpenAI::Util::AnyHash)) + audio: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Audio, OpenAI::Util::AnyHash)) ) - .returns( - T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Audio, OpenAI::Util::AnyHash)) - ) - end - def audio=(_) + .void end + attr_writer :audio # The contents of the assistant message. Required unless `tool_calls` or # `function_call` is specified. @@ -47,91 +38,46 @@ module OpenAI ) ) end - def content - end - - sig do - params( - _: T.nilable( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Chat::ChatCompletionContentPartText, - OpenAI::Models::Chat::ChatCompletionContentPartRefusal - ) - ] - ) - ) - ) - .returns( - T.nilable( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Chat::ChatCompletionContentPartText, - OpenAI::Models::Chat::ChatCompletionContentPartRefusal - ) - ] - ) - ) - ) - end - def content=(_) - end + attr_accessor :content # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::FunctionCall)) } - def function_call - end + attr_reader :function_call sig do params( - _: T.nilable( + function_call: T.nilable( T.any(OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::FunctionCall, OpenAI::Util::AnyHash) ) ) - .returns( - T.nilable( - T.any(OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::FunctionCall, OpenAI::Util::AnyHash) - ) - ) - end - def function_call=(_) + .void end + attr_writer :function_call # An optional name for the participant. Provides the model information to # differentiate between participants of the same role. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name # The refusal message by the assistant. sig { returns(T.nilable(String)) } - def refusal - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def refusal=(_) - end + attr_accessor :refusal # The tool calls generated by the model, such as function calls. sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionMessageToolCall])) } - def tool_calls - end + attr_reader :tool_calls sig do - params(_: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall, OpenAI::Util::AnyHash)]) - end - def tool_calls=(_) + params( + tool_calls: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall, OpenAI::Util::AnyHash)] + ) + .void end + attr_writer :tool_calls # Messages sent by the model in response to user messages. sig do @@ -192,12 +138,7 @@ module OpenAI class Audio < OpenAI::BaseModel # Unique identifier for a previous audio response from the model. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # Data about a previous audio response from the model. # [Learn more](https://platform.openai.com/docs/guides/audio). @@ -289,21 +230,11 @@ module OpenAI # hallucinate parameters not defined by your function schema. Validate the # arguments in your code before calling your function. sig { returns(String) } - def arguments - end - - sig { params(_: String).returns(String) } - def arguments=(_) - end + attr_accessor :arguments # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. diff --git a/rbi/lib/openai/models/chat/chat_completion_audio.rbi b/rbi/lib/openai/models/chat/chat_completion_audio.rbi index 5b7b1eae..7cd9cc72 100644 --- a/rbi/lib/openai/models/chat/chat_completion_audio.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_audio.rbi @@ -6,41 +6,21 @@ module OpenAI class ChatCompletionAudio < OpenAI::BaseModel # Unique identifier for this audio response. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # Base64 encoded audio bytes generated by the model, in the format specified in # the request. sig { returns(String) } - def data - end - - sig { params(_: String).returns(String) } - def data=(_) - end + attr_accessor :data # The Unix timestamp (in seconds) for when this audio response will no longer be # accessible on the server for use in multi-turn conversations. sig { returns(Integer) } - def expires_at - end - - sig { params(_: Integer).returns(Integer) } - def expires_at=(_) - end + attr_accessor :expires_at # Transcript of the audio generated by the model. sig { returns(String) } - def transcript - end - - sig { params(_: String).returns(String) } - def transcript=(_) - end + attr_accessor :transcript # If the audio output modality is requested, this object contains data about the # audio response from the model. diff --git a/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi b/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi index cd667fba..3555a183 100644 --- a/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_audio_param.rbi @@ -7,28 +7,12 @@ module OpenAI # Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, # or `pcm16`. sig { returns(OpenAI::Models::Chat::ChatCompletionAudioParam::Format::OrSymbol) } - def format_ - end - - sig do - params(_: OpenAI::Models::Chat::ChatCompletionAudioParam::Format::OrSymbol) - .returns(OpenAI::Models::Chat::ChatCompletionAudioParam::Format::OrSymbol) - end - def format_=(_) - end + attr_accessor :format_ # The voice the model uses to respond. Supported voices are `alloy`, `ash`, # `ballad`, `coral`, `echo`, `sage`, and `shimmer`. sig { returns(OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol) } - def voice - end - - sig do - params(_: OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol) - .returns(OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::OrSymbol) - end - def voice=(_) - end + attr_accessor :voice # Parameters for audio output. Required when audio output is requested with # `modalities: ["audio"]`. diff --git a/rbi/lib/openai/models/chat/chat_completion_chunk.rbi b/rbi/lib/openai/models/chat/chat_completion_chunk.rbi index e64d0cbc..9564a77e 100644 --- a/rbi/lib/openai/models/chat/chat_completion_chunk.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_chunk.rbi @@ -6,77 +6,39 @@ module OpenAI class ChatCompletionChunk < OpenAI::BaseModel # A unique identifier for the chat completion. Each chunk has the same ID. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # A list of chat completion choices. Can contain more than one elements if `n` is # greater than 1. Can also be empty for the last chunk if you set # `stream_options: {"include_usage": true}`. sig { returns(T::Array[OpenAI::Models::Chat::ChatCompletionChunk::Choice]) } - def choices - end - - sig do - params(_: T::Array[OpenAI::Models::Chat::ChatCompletionChunk::Choice]) - .returns(T::Array[OpenAI::Models::Chat::ChatCompletionChunk::Choice]) - end - def choices=(_) - end + attr_accessor :choices # The Unix timestamp (in seconds) of when the chat completion was created. Each # chunk has the same timestamp. sig { returns(Integer) } - def created - end - - sig { params(_: Integer).returns(Integer) } - def created=(_) - end + attr_accessor :created # The model to generate the completion. sig { returns(String) } - def model - end - - sig { params(_: String).returns(String) } - def model=(_) - end + attr_accessor :model # The object type, which is always `chat.completion.chunk`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The service tier used for processing the request. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::ServiceTier::TaggedSymbol)) } - def service_tier - end - - sig do - params(_: T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::ServiceTier::TaggedSymbol)) - .returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::ServiceTier::TaggedSymbol)) - end - def service_tier=(_) - end + attr_accessor :service_tier # This fingerprint represents the backend configuration that the model runs with. # Can be used in conjunction with the `seed` request parameter to understand when # backend changes have been made that might impact determinism. sig { returns(T.nilable(String)) } - def system_fingerprint - end + attr_reader :system_fingerprint - sig { params(_: String).returns(String) } - def system_fingerprint=(_) - end + sig { params(system_fingerprint: String).void } + attr_writer :system_fingerprint # An optional field that will only be present when you set # `stream_options: {"include_usage": true}` in your request. When present, it @@ -86,15 +48,10 @@ module OpenAI # **NOTE:** If the stream is interrupted or cancelled, you may not receive the # final usage chunk which contains the total token usage for the request. sig { returns(T.nilable(OpenAI::Models::CompletionUsage)) } - def usage - end + attr_reader :usage - sig do - params(_: T.nilable(T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash))) - end - def usage=(_) - end + sig { params(usage: T.nilable(T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash))).void } + attr_writer :usage # Represents a streamed chunk of a chat completion response returned by the model, # based on the provided input. @@ -145,15 +102,10 @@ module OpenAI class Choice < OpenAI::BaseModel # A chat completion delta generated by streamed model responses. sig { returns(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta) } - def delta - end + attr_reader :delta - sig do - params(_: T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta, OpenAI::Util::AnyHash)) - end - def delta=(_) - end + sig { params(delta: T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta, OpenAI::Util::AnyHash)).void } + attr_writer :delta # The reason the model stopped generating tokens. This will be `stop` if the model # hit a natural stop point or a provided stop sequence, `length` if the maximum @@ -162,40 +114,23 @@ module OpenAI # model called a tool, or `function_call` (deprecated) if the model called a # function. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol)) } - def finish_reason - end - - sig do - params(_: T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol)) - .returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::Choice::FinishReason::TaggedSymbol)) - end - def finish_reason=(_) - end + attr_accessor :finish_reason # The index of the choice in the list of choices. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # Log probability information for the choice. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs)) } - def logprobs - end + attr_reader :logprobs sig do params( - _: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs, OpenAI::Util::AnyHash)) + logprobs: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs, OpenAI::Util::AnyHash)) ) - .returns( - T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Logprobs, OpenAI::Util::AnyHash)) - ) - end - def logprobs=(_) + .void end + attr_writer :logprobs sig do params( @@ -226,65 +161,42 @@ module OpenAI class Delta < OpenAI::BaseModel # The contents of the chunk message. sig { returns(T.nilable(String)) } - def content - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def content=(_) - end + attr_accessor :content # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall)) } - def function_call - end + attr_reader :function_call sig do params( - _: T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall, OpenAI::Util::AnyHash) + function_call: T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall, OpenAI::Util::AnyHash) - ) - end - def function_call=(_) + .void end + attr_writer :function_call # The refusal message generated by the model. sig { returns(T.nilable(String)) } - def refusal - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def refusal=(_) - end + attr_accessor :refusal # The role of the author of this message. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::Role::TaggedSymbol)) } - def role - end + attr_reader :role - sig do - params(_: OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::Role::OrSymbol) - .returns(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::Role::OrSymbol) - end - def role=(_) - end + sig { params(role: OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::Role::OrSymbol).void } + attr_writer :role sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall])) } - def tool_calls - end + attr_reader :tool_calls sig do params( - _: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall, OpenAI::Util::AnyHash)] + tool_calls: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall, OpenAI::Util::AnyHash)] ) - .returns( - T::Array[T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall, OpenAI::Util::AnyHash)] - ) - end - def tool_calls=(_) + .void end + attr_writer :tool_calls # A chat completion delta generated by streamed model responses. sig do @@ -321,21 +233,17 @@ module OpenAI # hallucinate parameters not defined by your function schema. Validate the # arguments in your code before calling your function. sig { returns(T.nilable(String)) } - def arguments - end + attr_reader :arguments - sig { params(_: String).returns(String) } - def arguments=(_) - end + sig { params(arguments: String).void } + attr_writer :arguments # The name of the function to call. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. @@ -374,48 +282,32 @@ module OpenAI class ToolCall < OpenAI::BaseModel sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The ID of the tool call. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function)) } - def function - end + attr_reader :function sig do params( - _: T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function, OpenAI::Util::AnyHash) + function: T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function, OpenAI::Util::AnyHash) - ) - end - def function=(_) + .void end + attr_writer :function # The type of the tool. Currently, only `function` is supported. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Type::TaggedSymbol)) } - def type - end + attr_reader :type - sig do - params(_: OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Type::OrSymbol) - .returns(OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Type::OrSymbol) - end - def type=(_) - end + sig { params(type: OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Type::OrSymbol).void } + attr_writer :type sig do params( @@ -449,21 +341,17 @@ module OpenAI # hallucinate parameters not defined by your function schema. Validate the # arguments in your code before calling your function. sig { returns(T.nilable(String)) } - def arguments - end + attr_reader :arguments - sig { params(_: String).returns(String) } - def arguments=(_) - end + sig { params(arguments: String).void } + attr_writer :arguments # The name of the function to call. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name sig { params(arguments: String, name: String).returns(T.attached_class) } def self.new(arguments: nil, name: nil) @@ -531,27 +419,11 @@ module OpenAI class Logprobs < OpenAI::BaseModel # A list of message content tokens with log probability information. sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) } - def content - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) - .returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) - end - def content=(_) - end + attr_accessor :content # A list of message refusal tokens with log probability information. sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) } - def refusal - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) - .returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob])) - end - def refusal=(_) - end + attr_accessor :refusal # Log probability information for the choice. sig do diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part.rbi index 2392c0a6..ea7cbd9d 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part.rbi @@ -22,24 +22,17 @@ module OpenAI class File < OpenAI::BaseModel sig { returns(OpenAI::Models::Chat::ChatCompletionContentPart::File::File) } - def file - end + attr_reader :file sig do - params(_: T.any(OpenAI::Models::Chat::ChatCompletionContentPart::File::File, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Chat::ChatCompletionContentPart::File::File, OpenAI::Util::AnyHash)) - end - def file=(_) + params(file: T.any(OpenAI::Models::Chat::ChatCompletionContentPart::File::File, OpenAI::Util::AnyHash)) + .void end + attr_writer :file # The type of the content part. Always `file`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text # generation. @@ -61,30 +54,24 @@ module OpenAI # The base64 encoded file data, used when passing the file to the model as a # string. sig { returns(T.nilable(String)) } - def file_data - end + attr_reader :file_data - sig { params(_: String).returns(String) } - def file_data=(_) - end + sig { params(file_data: String).void } + attr_writer :file_data # The ID of an uploaded file to use as input. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The name of the file, used when passing the file to the model as a string. sig { returns(T.nilable(String)) } - def filename - end + attr_reader :filename - sig { params(_: String).returns(String) } - def filename=(_) - end + sig { params(filename: String).void } + attr_writer :filename sig { params(file_data: String, file_id: String, filename: String).returns(T.attached_class) } def self.new(file_data: nil, file_id: nil, filename: nil) diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi index af0de7f9..f856dce5 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part_image.rbi @@ -5,24 +5,19 @@ module OpenAI module Chat class ChatCompletionContentPartImage < OpenAI::BaseModel sig { returns(OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL) } - def image_url - end + attr_reader :image_url sig do - params(_: T.any(OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL, OpenAI::Util::AnyHash)) - end - def image_url=(_) + params( + image_url: T.any(OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :image_url # The type of the content part. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Learn about [image inputs](https://platform.openai.com/docs/guides/vision). sig do @@ -44,25 +39,15 @@ module OpenAI class ImageURL < OpenAI::BaseModel # Either a URL of the image or the base64 encoded image data. sig { returns(String) } - def url - end - - sig { params(_: String).returns(String) } - def url=(_) - end + attr_accessor :url # Specifies the detail level of the image. Learn more in the # [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding). sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::Detail::OrSymbol)) } - def detail - end + attr_reader :detail - sig do - params(_: OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::Detail::OrSymbol) - .returns(OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::Detail::OrSymbol) - end - def detail=(_) - end + sig { params(detail: OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::Detail::OrSymbol).void } + attr_writer :detail sig do params( diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi index 2abced72..318356fb 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part_input_audio.rbi @@ -5,28 +5,19 @@ module OpenAI module Chat class ChatCompletionContentPartInputAudio < OpenAI::BaseModel sig { returns(OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio) } - def input_audio - end + attr_reader :input_audio sig do params( - _: T.any(OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio, OpenAI::Util::AnyHash) + input_audio: T.any(OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio, OpenAI::Util::AnyHash) - ) - end - def input_audio=(_) + .void end + attr_writer :input_audio # The type of the content part. Always `input_audio`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Learn about [audio inputs](https://platform.openai.com/docs/guides/audio). sig do @@ -51,24 +42,11 @@ module OpenAI class InputAudio < OpenAI::BaseModel # Base64 encoded audio data. sig { returns(String) } - def data - end - - sig { params(_: String).returns(String) } - def data=(_) - end + attr_accessor :data # The format of the encoded audio data. Currently supports "wav" and "mp3". sig { returns(OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio::Format::OrSymbol) } - def format_ - end - - sig do - params(_: OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio::Format::OrSymbol) - .returns(OpenAI::Models::Chat::ChatCompletionContentPartInputAudio::InputAudio::Format::OrSymbol) - end - def format_=(_) - end + attr_accessor :format_ sig do params( diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi index 1cae47c2..788cfecf 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part_refusal.rbi @@ -6,21 +6,11 @@ module OpenAI class ChatCompletionContentPartRefusal < OpenAI::BaseModel # The refusal message generated by the model. sig { returns(String) } - def refusal - end - - sig { params(_: String).returns(String) } - def refusal=(_) - end + attr_accessor :refusal # The type of the content part. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { params(refusal: String, type: Symbol).returns(T.attached_class) } def self.new(refusal:, type: :refusal) diff --git a/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi b/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi index 2fcd20fa..1cb1a46c 100644 --- a/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_content_part_text.rbi @@ -6,21 +6,11 @@ module OpenAI class ChatCompletionContentPartText < OpenAI::BaseModel # The text content. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # The type of the content part. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Learn about # [text inputs](https://platform.openai.com/docs/guides/text-generation). diff --git a/rbi/lib/openai/models/chat/chat_completion_deleted.rbi b/rbi/lib/openai/models/chat/chat_completion_deleted.rbi index 8ef5a9d5..9affbd35 100644 --- a/rbi/lib/openai/models/chat/chat_completion_deleted.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_deleted.rbi @@ -6,30 +6,15 @@ module OpenAI class ChatCompletionDeleted < OpenAI::BaseModel # The ID of the chat completion that was deleted. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # Whether the chat completion was deleted. sig { returns(T::Boolean) } - def deleted - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def deleted=(_) - end + attr_accessor :deleted # The type of object being deleted. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } def self.new(id:, deleted:, object: :"chat.completion.deleted") diff --git a/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi index 216c218d..ddab2743 100644 --- a/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_developer_message_param.rbi @@ -6,34 +6,19 @@ module OpenAI class ChatCompletionDeveloperMessageParam < OpenAI::BaseModel # The contents of the developer message. sig { returns(T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) } - def content - end - - sig do - params(_: T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) - .returns(T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) - end - def content=(_) - end + attr_accessor :content # The role of the messages author, in this case `developer`. sig { returns(Symbol) } - def role - end - - sig { params(_: Symbol).returns(Symbol) } - def role=(_) - end + attr_accessor :role # An optional name for the participant. Provides the model information to # differentiate between participants of the same role. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name # Developer-provided instructions that the model should follow, regardless of # messages sent by the user. With o1 models and newer, `developer` messages diff --git a/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi b/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi index e1d6c904..11ce4c45 100644 --- a/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_function_call_option.rbi @@ -6,12 +6,7 @@ module OpenAI class ChatCompletionFunctionCallOption < OpenAI::BaseModel # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # Specifying a particular function via `{"name": "my_function"}` forces the model # to call that function. diff --git a/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi index 665339f5..43ae6ea4 100644 --- a/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_function_message_param.rbi @@ -6,30 +6,15 @@ module OpenAI class ChatCompletionFunctionMessageParam < OpenAI::BaseModel # The contents of the function message. sig { returns(T.nilable(String)) } - def content - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def content=(_) - end + attr_accessor :content # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # The role of the messages author, in this case `function`. sig { returns(Symbol) } - def role - end - - sig { params(_: Symbol).returns(Symbol) } - def role=(_) - end + attr_accessor :role sig { params(content: T.nilable(String), name: String, role: Symbol).returns(T.attached_class) } def self.new(content:, name:, role: :function) diff --git a/rbi/lib/openai/models/chat/chat_completion_message.rbi b/rbi/lib/openai/models/chat/chat_completion_message.rbi index 12d3f9c5..3d52bbbb 100644 --- a/rbi/lib/openai/models/chat/chat_completion_message.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_message.rbi @@ -6,82 +6,62 @@ module OpenAI class ChatCompletionMessage < OpenAI::BaseModel # The contents of the message. sig { returns(T.nilable(String)) } - def content - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def content=(_) - end + attr_accessor :content # The refusal message generated by the model. sig { returns(T.nilable(String)) } - def refusal - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def refusal=(_) - end + attr_accessor :refusal # The role of the author of this message. sig { returns(Symbol) } - def role - end - - sig { params(_: Symbol).returns(Symbol) } - def role=(_) - end + attr_accessor :role # Annotations for the message, when applicable, as when using the # [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionMessage::Annotation])) } - def annotations - end + attr_reader :annotations sig do - params(_: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessage::Annotation, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessage::Annotation, OpenAI::Util::AnyHash)]) - end - def annotations=(_) + params( + annotations: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessage::Annotation, OpenAI::Util::AnyHash)] + ) + .void end + attr_writer :annotations # If the audio output modality is requested, this object contains data about the # audio response from the model. # [Learn more](https://platform.openai.com/docs/guides/audio). sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionAudio)) } - def audio - end + attr_reader :audio - sig do - params(_: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAudio, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAudio, OpenAI::Util::AnyHash))) - end - def audio=(_) - end + sig { params(audio: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAudio, OpenAI::Util::AnyHash))).void } + attr_writer :audio # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionMessage::FunctionCall)) } - def function_call - end + attr_reader :function_call sig do - params(_: T.any(OpenAI::Models::Chat::ChatCompletionMessage::FunctionCall, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Chat::ChatCompletionMessage::FunctionCall, OpenAI::Util::AnyHash)) - end - def function_call=(_) + params( + function_call: T.any(OpenAI::Models::Chat::ChatCompletionMessage::FunctionCall, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :function_call # The tool calls generated by the model, such as function calls. sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionMessageToolCall])) } - def tool_calls - end + attr_reader :tool_calls sig do - params(_: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall, OpenAI::Util::AnyHash)]) - end - def tool_calls=(_) + params( + tool_calls: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall, OpenAI::Util::AnyHash)] + ) + .void end + attr_writer :tool_calls # A chat completion message generated by the model. sig do @@ -119,28 +99,19 @@ module OpenAI class Annotation < OpenAI::BaseModel # The type of the URL citation. Always `url_citation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A URL citation when using web search. sig { returns(OpenAI::Models::Chat::ChatCompletionMessage::Annotation::URLCitation) } - def url_citation - end + attr_reader :url_citation sig do params( - _: T.any(OpenAI::Models::Chat::ChatCompletionMessage::Annotation::URLCitation, OpenAI::Util::AnyHash) + url_citation: T.any(OpenAI::Models::Chat::ChatCompletionMessage::Annotation::URLCitation, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::Chat::ChatCompletionMessage::Annotation::URLCitation, OpenAI::Util::AnyHash) - ) - end - def url_citation=(_) + .void end + attr_writer :url_citation # A URL citation when using web search. sig do @@ -165,39 +136,19 @@ module OpenAI class URLCitation < OpenAI::BaseModel # The index of the last character of the URL citation in the message. sig { returns(Integer) } - def end_index - end - - sig { params(_: Integer).returns(Integer) } - def end_index=(_) - end + attr_accessor :end_index # The index of the first character of the URL citation in the message. sig { returns(Integer) } - def start_index - end - - sig { params(_: Integer).returns(Integer) } - def start_index=(_) - end + attr_accessor :start_index # The title of the web resource. sig { returns(String) } - def title - end - - sig { params(_: String).returns(String) } - def title=(_) - end + attr_accessor :title # The URL of the web resource. sig { returns(String) } - def url - end - - sig { params(_: String).returns(String) } - def url=(_) - end + attr_accessor :url # A URL citation when using web search. sig do @@ -223,21 +174,11 @@ module OpenAI # hallucinate parameters not defined by your function schema. Validate the # arguments in your code before calling your function. sig { returns(String) } - def arguments - end - - sig { params(_: String).returns(String) } - def arguments=(_) - end + attr_accessor :arguments # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # Deprecated and replaced by `tool_calls`. The name and arguments of a function # that should be called, as generated by the model. diff --git a/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi b/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi index b4dcff08..851dff7f 100644 --- a/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_message_tool_call.rbi @@ -6,33 +6,23 @@ module OpenAI class ChatCompletionMessageToolCall < OpenAI::BaseModel # The ID of the tool call. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The function that the model called. sig { returns(OpenAI::Models::Chat::ChatCompletionMessageToolCall::Function) } - def function - end + attr_reader :function sig do - params(_: T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall::Function, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall::Function, OpenAI::Util::AnyHash)) - end - def function=(_) + params( + function: T.any(OpenAI::Models::Chat::ChatCompletionMessageToolCall::Function, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :function # The type of the tool. Currently, only `function` is supported. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params( @@ -60,21 +50,11 @@ module OpenAI # hallucinate parameters not defined by your function schema. Validate the # arguments in your code before calling your function. sig { returns(String) } - def arguments - end - - sig { params(_: String).returns(String) } - def arguments=(_) - end + attr_accessor :arguments # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # The function that the model called. sig { params(arguments: String, name: String).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi b/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi index a03dfbeb..4c4f4e58 100644 --- a/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_named_tool_choice.rbi @@ -5,24 +5,19 @@ module OpenAI module Chat class ChatCompletionNamedToolChoice < OpenAI::BaseModel sig { returns(OpenAI::Models::Chat::ChatCompletionNamedToolChoice::Function) } - def function - end + attr_reader :function sig do - params(_: T.any(OpenAI::Models::Chat::ChatCompletionNamedToolChoice::Function, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Chat::ChatCompletionNamedToolChoice::Function, OpenAI::Util::AnyHash)) - end - def function=(_) + params( + function: T.any(OpenAI::Models::Chat::ChatCompletionNamedToolChoice::Function, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :function # The type of the tool. Currently, only `function` is supported. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Specifies a tool the model should use. Use to force the model to call a specific # function. @@ -43,12 +38,7 @@ module OpenAI class Function < OpenAI::BaseModel # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name sig { params(name: String).returns(T.attached_class) } def self.new(name:) diff --git a/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi b/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi index 472440af..34ebf6a5 100644 --- a/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_prediction_content.rbi @@ -8,25 +8,12 @@ module OpenAI # generated tokens would match this content, the entire model response can be # returned much more quickly. sig { returns(T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) } - def content - end - - sig do - params(_: T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) - .returns(T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) - end - def content=(_) - end + attr_accessor :content # The type of the predicted content you want to provide. This type is currently # always `content`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Static predicted output content, such as the content of a text file that is # being regenerated. diff --git a/rbi/lib/openai/models/chat/chat_completion_store_message.rbi b/rbi/lib/openai/models/chat/chat_completion_store_message.rbi index 50654ac0..78838f7f 100644 --- a/rbi/lib/openai/models/chat/chat_completion_store_message.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_store_message.rbi @@ -6,12 +6,7 @@ module OpenAI class ChatCompletionStoreMessage < OpenAI::Models::Chat::ChatCompletionMessage # The identifier of the chat message. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # A chat completion message generated by the model. sig { params(id: String).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi b/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi index fe3e980e..bb0ee0d9 100644 --- a/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_stream_options.rbi @@ -12,12 +12,10 @@ module OpenAI # **NOTE:** If the stream is interrupted, you may not receive the final usage # chunk which contains the total token usage for the request. sig { returns(T.nilable(T::Boolean)) } - def include_usage - end + attr_reader :include_usage - sig { params(_: T::Boolean).returns(T::Boolean) } - def include_usage=(_) - end + sig { params(include_usage: T::Boolean).void } + attr_writer :include_usage # Options for streaming response. Only set this when you set `stream: true`. sig { params(include_usage: T::Boolean).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi index 6c3b80e1..d3cf9fc5 100644 --- a/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_system_message_param.rbi @@ -6,34 +6,19 @@ module OpenAI class ChatCompletionSystemMessageParam < OpenAI::BaseModel # The contents of the system message. sig { returns(T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) } - def content - end - - sig do - params(_: T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) - .returns(T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) - end - def content=(_) - end + attr_accessor :content # The role of the messages author, in this case `system`. sig { returns(Symbol) } - def role - end - - sig { params(_: Symbol).returns(Symbol) } - def role=(_) - end + attr_accessor :role # An optional name for the participant. Provides the model information to # differentiate between participants of the same role. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name # Developer-provided instructions that the model should follow, regardless of # messages sent by the user. With o1 models and newer, use `developer` messages diff --git a/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi b/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi index ea88fd66..33ce4b9e 100644 --- a/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_token_logprob.rbi @@ -6,49 +6,26 @@ module OpenAI class ChatCompletionTokenLogprob < OpenAI::BaseModel # The token. sig { returns(String) } - def token - end - - sig { params(_: String).returns(String) } - def token=(_) - end + attr_accessor :token # A list of integers representing the UTF-8 bytes representation of the token. # Useful in instances where characters are represented by multiple tokens and # their byte representations must be combined to generate the correct text # representation. Can be `null` if there is no bytes representation for the token. sig { returns(T.nilable(T::Array[Integer])) } - def bytes - end - - sig { params(_: T.nilable(T::Array[Integer])).returns(T.nilable(T::Array[Integer])) } - def bytes=(_) - end + attr_accessor :bytes # The log probability of this token, if it is within the top 20 most likely # tokens. Otherwise, the value `-9999.0` is used to signify that the token is very # unlikely. sig { returns(Float) } - def logprob - end - - sig { params(_: Float).returns(Float) } - def logprob=(_) - end + attr_accessor :logprob # List of the most likely tokens and their log probability, at this token # position. In rare cases, there may be fewer than the number of requested # `top_logprobs` returned. sig { returns(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob::TopLogprob]) } - def top_logprobs - end - - sig do - params(_: T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob::TopLogprob]) - .returns(T::Array[OpenAI::Models::Chat::ChatCompletionTokenLogprob::TopLogprob]) - end - def top_logprobs=(_) - end + attr_accessor :top_logprobs sig do params( @@ -79,35 +56,20 @@ module OpenAI class TopLogprob < OpenAI::BaseModel # The token. sig { returns(String) } - def token - end - - sig { params(_: String).returns(String) } - def token=(_) - end + attr_accessor :token # A list of integers representing the UTF-8 bytes representation of the token. # Useful in instances where characters are represented by multiple tokens and # their byte representations must be combined to generate the correct text # representation. Can be `null` if there is no bytes representation for the token. sig { returns(T.nilable(T::Array[Integer])) } - def bytes - end - - sig { params(_: T.nilable(T::Array[Integer])).returns(T.nilable(T::Array[Integer])) } - def bytes=(_) - end + attr_accessor :bytes # The log probability of this token, if it is within the top 20 most likely # tokens. Otherwise, the value `-9999.0` is used to signify that the token is very # unlikely. sig { returns(Float) } - def logprob - end - - sig { params(_: Float).returns(Float) } - def logprob=(_) - end + attr_accessor :logprob sig do params( diff --git a/rbi/lib/openai/models/chat/chat_completion_tool.rbi b/rbi/lib/openai/models/chat/chat_completion_tool.rbi index 8cd4fe09..03b8ecd1 100644 --- a/rbi/lib/openai/models/chat/chat_completion_tool.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_tool.rbi @@ -5,24 +5,14 @@ module OpenAI module Chat class ChatCompletionTool < OpenAI::BaseModel sig { returns(OpenAI::Models::FunctionDefinition) } - def function - end + attr_reader :function - sig do - params(_: T.any(OpenAI::Models::FunctionDefinition, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FunctionDefinition, OpenAI::Util::AnyHash)) - end - def function=(_) - end + sig { params(function: T.any(OpenAI::Models::FunctionDefinition, OpenAI::Util::AnyHash)).void } + attr_writer :function # The type of the tool. Currently, only `function` is supported. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params(function: T.any(OpenAI::Models::FunctionDefinition, OpenAI::Util::AnyHash), type: Symbol) diff --git a/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi index bd333634..8a16e044 100644 --- a/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_tool_message_param.rbi @@ -6,33 +6,15 @@ module OpenAI class ChatCompletionToolMessageParam < OpenAI::BaseModel # The contents of the tool message. sig { returns(T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) } - def content - end - - sig do - params(_: T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) - .returns(T.any(String, T::Array[OpenAI::Models::Chat::ChatCompletionContentPartText])) - end - def content=(_) - end + attr_accessor :content # The role of the messages author, in this case `tool`. sig { returns(Symbol) } - def role - end - - sig { params(_: Symbol).returns(Symbol) } - def role=(_) - end + attr_accessor :role # Tool call that this message is responding to. sig { returns(String) } - def tool_call_id - end - - sig { params(_: String).returns(String) } - def tool_call_id=(_) - end + attr_accessor :tool_call_id sig do params( diff --git a/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi b/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi index a9e388f6..96a94d0d 100644 --- a/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi +++ b/rbi/lib/openai/models/chat/chat_completion_user_message_param.rbi @@ -20,58 +20,19 @@ module OpenAI ) ) end - def content - end - - sig do - params( - _: T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Chat::ChatCompletionContentPartText, - OpenAI::Models::Chat::ChatCompletionContentPartImage, - OpenAI::Models::Chat::ChatCompletionContentPartInputAudio, - OpenAI::Models::Chat::ChatCompletionContentPart::File - ) - ] - ) - ) - .returns( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Chat::ChatCompletionContentPartText, - OpenAI::Models::Chat::ChatCompletionContentPartImage, - OpenAI::Models::Chat::ChatCompletionContentPartInputAudio, - OpenAI::Models::Chat::ChatCompletionContentPart::File - ) - ] - ) - ) - end - def content=(_) - end + attr_accessor :content # The role of the messages author, in this case `user`. sig { returns(Symbol) } - def role - end - - sig { params(_: Symbol).returns(Symbol) } - def role=(_) - end + attr_accessor :role # An optional name for the participant. Provides the model information to # differentiate between participants of the same role. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name # Messages sent by an end user, containing prompts or additional context # information. diff --git a/rbi/lib/openai/models/chat/completion_create_params.rbi b/rbi/lib/openai/models/chat/completion_create_params.rbi index cf85872a..cd89b96c 100644 --- a/rbi/lib/openai/models/chat/completion_create_params.rbi +++ b/rbi/lib/openai/models/chat/completion_create_params.rbi @@ -27,37 +27,7 @@ module OpenAI ] ) end - def messages - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Chat::ChatCompletionDeveloperMessageParam, - OpenAI::Models::Chat::ChatCompletionSystemMessageParam, - OpenAI::Models::Chat::ChatCompletionUserMessageParam, - OpenAI::Models::Chat::ChatCompletionAssistantMessageParam, - OpenAI::Models::Chat::ChatCompletionToolMessageParam, - OpenAI::Models::Chat::ChatCompletionFunctionMessageParam - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Chat::ChatCompletionDeveloperMessageParam, - OpenAI::Models::Chat::ChatCompletionSystemMessageParam, - OpenAI::Models::Chat::ChatCompletionUserMessageParam, - OpenAI::Models::Chat::ChatCompletionAssistantMessageParam, - OpenAI::Models::Chat::ChatCompletionToolMessageParam, - OpenAI::Models::Chat::ChatCompletionFunctionMessageParam - ) - ] - ) - end - def messages=(_) - end + attr_accessor :messages # Model ID used to generate the response, like `gpt-4o` or `o1`. OpenAI offers a # wide range of models with different capabilities, performance characteristics, @@ -65,40 +35,22 @@ module OpenAI # [model guide](https://platform.openai.com/docs/models) to browse and compare # available models. sig { returns(T.any(String, OpenAI::Models::ChatModel::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::ChatModel::OrSymbol)) - .returns(T.any(String, OpenAI::Models::ChatModel::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # Parameters for audio output. Required when audio output is requested with # `modalities: ["audio"]`. # [Learn more](https://platform.openai.com/docs/guides/audio). sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionAudioParam)) } - def audio - end + attr_reader :audio - sig do - params(_: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAudioParam, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAudioParam, OpenAI::Util::AnyHash))) - end - def audio=(_) - end + sig { params(audio: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionAudioParam, OpenAI::Util::AnyHash))).void } + attr_writer :audio # Number between -2.0 and 2.0. Positive values penalize new tokens based on their # existing frequency in the text so far, decreasing the model's likelihood to # repeat the same line verbatim. sig { returns(T.nilable(Float)) } - def frequency_penalty - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def frequency_penalty=(_) - end + attr_accessor :frequency_penalty # Deprecated in favor of `tool_choice`. # @@ -124,41 +76,33 @@ module OpenAI ) ) end - def function_call - end + attr_reader :function_call sig do params( - _: T.any( + function_call: T.any( OpenAI::Models::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode::OrSymbol, OpenAI::Models::Chat::ChatCompletionFunctionCallOption, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Chat::CompletionCreateParams::FunctionCall::FunctionCallMode::OrSymbol, - OpenAI::Models::Chat::ChatCompletionFunctionCallOption, - OpenAI::Util::AnyHash - ) - ) - end - def function_call=(_) + .void end + attr_writer :function_call # Deprecated in favor of `tools`. # # A list of functions the model may generate JSON inputs for. sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::CompletionCreateParams::Function])) } - def functions - end + attr_reader :functions sig do - params(_: T::Array[T.any(OpenAI::Models::Chat::CompletionCreateParams::Function, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Chat::CompletionCreateParams::Function, OpenAI::Util::AnyHash)]) - end - def functions=(_) + params( + functions: T::Array[T.any(OpenAI::Models::Chat::CompletionCreateParams::Function, OpenAI::Util::AnyHash)] + ) + .void end + attr_writer :functions # Modify the likelihood of specified tokens appearing in the completion. # @@ -169,34 +113,19 @@ module OpenAI # increase likelihood of selection; values like -100 or 100 should result in a ban # or exclusive selection of the relevant token. sig { returns(T.nilable(T::Hash[Symbol, Integer])) } - def logit_bias - end - - sig { params(_: T.nilable(T::Hash[Symbol, Integer])).returns(T.nilable(T::Hash[Symbol, Integer])) } - def logit_bias=(_) - end + attr_accessor :logit_bias # Whether to return log probabilities of the output tokens or not. If true, # returns the log probabilities of each output token returned in the `content` of # `message`. sig { returns(T.nilable(T::Boolean)) } - def logprobs - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def logprobs=(_) - end + attr_accessor :logprobs # An upper bound for the number of tokens that can be generated for a completion, # including visible output tokens and # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). sig { returns(T.nilable(Integer)) } - def max_completion_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_completion_tokens=(_) - end + attr_accessor :max_completion_tokens # The maximum number of [tokens](/tokenizer) that can be generated in the chat # completion. This value can be used to control @@ -206,12 +135,7 @@ module OpenAI # compatible with # [o1 series models](https://platform.openai.com/docs/guides/reasoning). sig { returns(T.nilable(Integer)) } - def max_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_tokens=(_) - end + attr_accessor :max_tokens # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -220,12 +144,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # Output types that you would like the model to generate. Most models are capable # of generating text, which is the default: @@ -238,61 +157,41 @@ module OpenAI # # `["text", "audio"]` sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::CompletionCreateParams::Modality::OrSymbol])) } - def modalities - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Chat::CompletionCreateParams::Modality::OrSymbol])) - .returns(T.nilable(T::Array[OpenAI::Models::Chat::CompletionCreateParams::Modality::OrSymbol])) - end - def modalities=(_) - end + attr_accessor :modalities # How many chat completion choices to generate for each input message. Note that # you will be charged based on the number of generated tokens across all of the # choices. Keep `n` as `1` to minimize costs. sig { returns(T.nilable(Integer)) } - def n - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def n=(_) - end + attr_accessor :n # Whether to enable # [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) # during tool use. sig { returns(T.nilable(T::Boolean)) } - def parallel_tool_calls - end + attr_reader :parallel_tool_calls - sig { params(_: T::Boolean).returns(T::Boolean) } - def parallel_tool_calls=(_) - end + sig { params(parallel_tool_calls: T::Boolean).void } + attr_writer :parallel_tool_calls # Static predicted output content, such as the content of a text file that is # being regenerated. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionPredictionContent)) } - def prediction - end + attr_reader :prediction sig do - params(_: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionPredictionContent, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionPredictionContent, OpenAI::Util::AnyHash))) - end - def prediction=(_) + params( + prediction: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionPredictionContent, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :prediction # Number between -2.0 and 2.0. Positive values penalize new tokens based on # whether they appear in the text so far, increasing the model's likelihood to # talk about new topics. sig { returns(T.nilable(Float)) } - def presence_penalty - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def presence_penalty=(_) - end + attr_accessor :presence_penalty # **o-series models only** # @@ -301,15 +200,7 @@ module OpenAI # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can # result in faster responses and fewer tokens used on reasoning in a response. sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) } - def reasoning_effort - end - - sig do - params(_: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - end - def reasoning_effort=(_) - end + attr_accessor :reasoning_effort # An object specifying the format that the model must output. # @@ -332,29 +223,20 @@ module OpenAI ) ) end - def response_format - end + attr_reader :response_format sig do params( - _: T.any( + response_format: T.any( OpenAI::Models::ResponseFormatText, OpenAI::Util::AnyHash, OpenAI::Models::ResponseFormatJSONSchema, OpenAI::Models::ResponseFormatJSONObject ) ) - .returns( - T.any( - OpenAI::Models::ResponseFormatText, - OpenAI::Util::AnyHash, - OpenAI::Models::ResponseFormatJSONSchema, - OpenAI::Models::ResponseFormatJSONObject - ) - ) - end - def response_format=(_) + .void end + attr_writer :response_format # This feature is in Beta. If specified, our system will make a best effort to # sample deterministically, such that repeated requests with the same `seed` and @@ -362,12 +244,7 @@ module OpenAI # should refer to the `system_fingerprint` response parameter to monitor changes # in the backend. sig { returns(T.nilable(Integer)) } - def seed - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def seed=(_) - end + attr_accessor :seed # Specifies the latency tier to use for processing the request. This parameter is # relevant for customers subscribed to the scale tier service: @@ -384,69 +261,37 @@ module OpenAI # When this parameter is set, the response body will include the `service_tier` # utilized. sig { returns(T.nilable(OpenAI::Models::Chat::CompletionCreateParams::ServiceTier::OrSymbol)) } - def service_tier - end - - sig do - params(_: T.nilable(OpenAI::Models::Chat::CompletionCreateParams::ServiceTier::OrSymbol)) - .returns(T.nilable(OpenAI::Models::Chat::CompletionCreateParams::ServiceTier::OrSymbol)) - end - def service_tier=(_) - end + attr_accessor :service_tier # Up to 4 sequences where the API will stop generating further tokens. The # returned text will not contain the stop sequence. sig { returns(T.nilable(T.any(String, T::Array[String]))) } - def stop - end - - sig do - params( - _: T.nilable( - T.any( - String, - T::Array[String] - ) - ) - ).returns(T.nilable(T.any(String, T::Array[String]))) - end - def stop=(_) - end + attr_accessor :stop # Whether or not to store the output of this chat completion request for use in # our [model distillation](https://platform.openai.com/docs/guides/distillation) # or [evals](https://platform.openai.com/docs/guides/evals) products. sig { returns(T.nilable(T::Boolean)) } - def store - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def store=(_) - end + attr_accessor :store # Options for streaming response. Only set this when you set `stream: true`. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionStreamOptions)) } - def stream_options - end + attr_reader :stream_options sig do - params(_: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionStreamOptions, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionStreamOptions, OpenAI::Util::AnyHash))) - end - def stream_options=(_) + params( + stream_options: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionStreamOptions, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :stream_options # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more # focused and deterministic. We generally recommend altering this or `top_p` but # not both. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # Controls which (if any) tool is called by the model. `none` means the model will # not call any tool and instead generates a message. `auto` means the model can @@ -467,52 +312,34 @@ module OpenAI ) ) end - def tool_choice - end + attr_reader :tool_choice sig do params( - _: T.any( + tool_choice: T.any( OpenAI::Models::Chat::ChatCompletionToolChoiceOption::Auto::OrSymbol, OpenAI::Models::Chat::ChatCompletionNamedToolChoice, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Chat::ChatCompletionToolChoiceOption::Auto::OrSymbol, - OpenAI::Models::Chat::ChatCompletionNamedToolChoice, - OpenAI::Util::AnyHash - ) - ) - end - def tool_choice=(_) + .void end + attr_writer :tool_choice # A list of tools the model may call. Currently, only functions are supported as a # tool. Use this to provide a list of functions the model may generate JSON inputs # for. A max of 128 functions are supported. sig { returns(T.nilable(T::Array[OpenAI::Models::Chat::ChatCompletionTool])) } - def tools - end + attr_reader :tools - sig do - params(_: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionTool, OpenAI::Util::AnyHash)]) - .returns(T::Array[T.any(OpenAI::Models::Chat::ChatCompletionTool, OpenAI::Util::AnyHash)]) - end - def tools=(_) - end + sig { params(tools: T::Array[T.any(OpenAI::Models::Chat::ChatCompletionTool, OpenAI::Util::AnyHash)]).void } + attr_writer :tools # An integer between 0 and 20 specifying the number of most likely tokens to # return at each token position, each with an associated log probability. # `logprobs` must be set to `true` if this parameter is used. sig { returns(T.nilable(Integer)) } - def top_logprobs - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def top_logprobs=(_) - end + attr_accessor :top_logprobs # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -520,37 +347,30 @@ module OpenAI # # We generally recommend altering this or `temperature` but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). sig { returns(T.nilable(String)) } - def user - end + attr_reader :user - sig { params(_: String).returns(String) } - def user=(_) - end + sig { params(user: String).void } + attr_writer :user # This tool searches the web for relevant results to use in a response. Learn more # about the # [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). sig { returns(T.nilable(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions)) } - def web_search_options - end + attr_reader :web_search_options sig do - params(_: T.any(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions, OpenAI::Util::AnyHash)) - end - def web_search_options=(_) + params( + web_search_options: T.any(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :web_search_options sig do params( @@ -794,22 +614,15 @@ module OpenAI # The name of the function to be called. Must be a-z, A-Z, 0-9, or contain # underscores and dashes, with a maximum length of 64. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # A description of what the function does, used by the model to choose when and # how to call the function. sig { returns(T.nilable(String)) } - def description - end + attr_reader :description - sig { params(_: String).returns(String) } - def description=(_) - end + sig { params(description: String).void } + attr_writer :description # The parameters the functions accepts, described as a JSON Schema object. See the # [guide](https://platform.openai.com/docs/guides/function-calling) for examples, @@ -819,12 +632,10 @@ module OpenAI # # Omitting `parameters` defines a function with an empty parameter list. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - def parameters - end + attr_reader :parameters - sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } - def parameters=(_) - end + sig { params(parameters: T::Hash[Symbol, T.anything]).void } + attr_writer :parameters sig do params(name: String, description: String, parameters: T::Hash[Symbol, T.anything]) @@ -948,35 +759,29 @@ module OpenAI T.nilable(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize::OrSymbol) ) end - def search_context_size - end + attr_reader :search_context_size sig do - params(_: OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize::OrSymbol) - .returns(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize::OrSymbol) - end - def search_context_size=(_) + params( + search_context_size: OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::SearchContextSize::OrSymbol + ) + .void end + attr_writer :search_context_size # Approximate location parameters for the search. sig { returns(T.nilable(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation)) } - def user_location - end + attr_reader :user_location sig do params( - _: T.nilable( + user_location: T.nilable( T.any(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation, OpenAI::Util::AnyHash) ) ) - .returns( - T.nilable( - T.any(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation, OpenAI::Util::AnyHash) - ) - ) - end - def user_location=(_) + .void end + attr_writer :user_location # This tool searches the web for relevant results to use in a response. Learn more # about the @@ -1051,34 +856,22 @@ module OpenAI class UserLocation < OpenAI::BaseModel # Approximate location parameters for the search. sig { returns(OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::Approximate) } - def approximate - end + attr_reader :approximate sig do params( - _: T.any( + approximate: T.any( OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::Approximate, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::Chat::CompletionCreateParams::WebSearchOptions::UserLocation::Approximate, - OpenAI::Util::AnyHash - ) - ) - end - def approximate=(_) + .void end + attr_writer :approximate # The type of location approximation. Always `approximate`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Approximate location parameters for the search. sig do @@ -1109,41 +902,33 @@ module OpenAI class Approximate < OpenAI::BaseModel # Free text input for the city of the user, e.g. `San Francisco`. sig { returns(T.nilable(String)) } - def city - end + attr_reader :city - sig { params(_: String).returns(String) } - def city=(_) - end + sig { params(city: String).void } + attr_writer :city # The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of # the user, e.g. `US`. sig { returns(T.nilable(String)) } - def country - end + attr_reader :country - sig { params(_: String).returns(String) } - def country=(_) - end + sig { params(country: String).void } + attr_writer :country # Free text input for the region of the user, e.g. `California`. sig { returns(T.nilable(String)) } - def region - end + attr_reader :region - sig { params(_: String).returns(String) } - def region=(_) - end + sig { params(region: String).void } + attr_writer :region # The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the # user, e.g. `America/Los_Angeles`. sig { returns(T.nilable(String)) } - def timezone - end + attr_reader :timezone - sig { params(_: String).returns(String) } - def timezone=(_) - end + sig { params(timezone: String).void } + attr_writer :timezone # Approximate location parameters for the search. sig do diff --git a/rbi/lib/openai/models/chat/completion_list_params.rbi b/rbi/lib/openai/models/chat/completion_list_params.rbi index eb6f581d..b4b185ec 100644 --- a/rbi/lib/openai/models/chat/completion_list_params.rbi +++ b/rbi/lib/openai/models/chat/completion_list_params.rbi @@ -9,54 +9,38 @@ module OpenAI # Identifier for the last chat completion from the previous pagination request. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # Number of Chat Completions to retrieve. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # A list of metadata keys to filter the Chat Completions by. Example: # # `metadata[key1]=value1&metadata[key2]=value2` sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The model used to generate the Chat Completions. sig { returns(T.nilable(String)) } - def model - end + attr_reader :model - sig { params(_: String).returns(String) } - def model=(_) - end + sig { params(model: String).void } + attr_writer :model # Sort order for Chat Completions by timestamp. Use `asc` for ascending order or # `desc` for descending order. Defaults to `asc`. sig { returns(T.nilable(OpenAI::Models::Chat::CompletionListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::Chat::CompletionListParams::Order::OrSymbol) - .returns(OpenAI::Models::Chat::CompletionListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::Chat::CompletionListParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/chat/completion_update_params.rbi b/rbi/lib/openai/models/chat/completion_update_params.rbi index 0b68282e..c039b140 100644 --- a/rbi/lib/openai/models/chat/completion_update_params.rbi +++ b/rbi/lib/openai/models/chat/completion_update_params.rbi @@ -14,12 +14,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( diff --git a/rbi/lib/openai/models/chat/completions/message_list_params.rbi b/rbi/lib/openai/models/chat/completions/message_list_params.rbi index 0a60c940..382d3dd1 100644 --- a/rbi/lib/openai/models/chat/completions/message_list_params.rbi +++ b/rbi/lib/openai/models/chat/completions/message_list_params.rbi @@ -10,34 +10,25 @@ module OpenAI # Identifier for the last message from the previous pagination request. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # Number of messages to retrieve. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order for messages by timestamp. Use `asc` for ascending order or `desc` # for descending order. Defaults to `asc`. sig { returns(T.nilable(OpenAI::Models::Chat::Completions::MessageListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::Chat::Completions::MessageListParams::Order::OrSymbol) - .returns(OpenAI::Models::Chat::Completions::MessageListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::Chat::Completions::MessageListParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/comparison_filter.rbi b/rbi/lib/openai/models/comparison_filter.rbi index d9019724..58689eef 100644 --- a/rbi/lib/openai/models/comparison_filter.rbi +++ b/rbi/lib/openai/models/comparison_filter.rbi @@ -5,12 +5,7 @@ module OpenAI class ComparisonFilter < OpenAI::BaseModel # The key to compare against the value. sig { returns(String) } - def key - end - - sig { params(_: String).returns(String) } - def key=(_) - end + attr_accessor :key # Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. # @@ -21,25 +16,12 @@ module OpenAI # - `lt`: less than # - `lte`: less than or equal sig { returns(OpenAI::Models::ComparisonFilter::Type::OrSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::ComparisonFilter::Type::OrSymbol) - .returns(OpenAI::Models::ComparisonFilter::Type::OrSymbol) - end - def type=(_) - end + attr_accessor :type # The value to compare against the attribute key; supports string, number, or # boolean types. sig { returns(T.any(String, Float, T::Boolean)) } - def value - end - - sig { params(_: T.any(String, Float, T::Boolean)).returns(T.any(String, Float, T::Boolean)) } - def value=(_) - end + attr_accessor :value # A filter used to compare a specified attribute key to a given value using a # defined comparison operation. diff --git a/rbi/lib/openai/models/completion.rbi b/rbi/lib/openai/models/completion.rbi index e270ee5f..0f9d002f 100644 --- a/rbi/lib/openai/models/completion.rbi +++ b/rbi/lib/openai/models/completion.rbi @@ -5,72 +5,40 @@ module OpenAI class Completion < OpenAI::BaseModel # A unique identifier for the completion. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The list of completion choices the model generated for the input prompt. sig { returns(T::Array[OpenAI::Models::CompletionChoice]) } - def choices - end - - sig { params(_: T::Array[OpenAI::Models::CompletionChoice]).returns(T::Array[OpenAI::Models::CompletionChoice]) } - def choices=(_) - end + attr_accessor :choices # The Unix timestamp (in seconds) of when the completion was created. sig { returns(Integer) } - def created - end - - sig { params(_: Integer).returns(Integer) } - def created=(_) - end + attr_accessor :created # The model used for completion. sig { returns(String) } - def model - end - - sig { params(_: String).returns(String) } - def model=(_) - end + attr_accessor :model # The object type, which is always "text_completion" sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # This fingerprint represents the backend configuration that the model runs with. # # Can be used in conjunction with the `seed` request parameter to understand when # backend changes have been made that might impact determinism. sig { returns(T.nilable(String)) } - def system_fingerprint - end + attr_reader :system_fingerprint - sig { params(_: String).returns(String) } - def system_fingerprint=(_) - end + sig { params(system_fingerprint: String).void } + attr_writer :system_fingerprint # Usage statistics for the completion request. sig { returns(T.nilable(OpenAI::Models::CompletionUsage)) } - def usage - end + attr_reader :usage - sig do - params(_: T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash)) - end - def usage=(_) - end + sig { params(usage: T.any(OpenAI::Models::CompletionUsage, OpenAI::Util::AnyHash)).void } + attr_writer :usage # Represents a completion response from the API. Note: both the streamed and # non-streamed response objects share the same shape (unlike the chat endpoint). diff --git a/rbi/lib/openai/models/completion_choice.rbi b/rbi/lib/openai/models/completion_choice.rbi index bdd63223..8e9b757d 100644 --- a/rbi/lib/openai/models/completion_choice.rbi +++ b/rbi/lib/openai/models/completion_choice.rbi @@ -8,42 +8,19 @@ module OpenAI # number of tokens specified in the request was reached, or `content_filter` if # content was omitted due to a flag from our content filters. sig { returns(OpenAI::Models::CompletionChoice::FinishReason::TaggedSymbol) } - def finish_reason - end - - sig do - params(_: OpenAI::Models::CompletionChoice::FinishReason::TaggedSymbol) - .returns(OpenAI::Models::CompletionChoice::FinishReason::TaggedSymbol) - end - def finish_reason=(_) - end + attr_accessor :finish_reason sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index sig { returns(T.nilable(OpenAI::Models::CompletionChoice::Logprobs)) } - def logprobs - end + attr_reader :logprobs - sig do - params(_: T.nilable(T.any(OpenAI::Models::CompletionChoice::Logprobs, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::CompletionChoice::Logprobs, OpenAI::Util::AnyHash))) - end - def logprobs=(_) - end + sig { params(logprobs: T.nilable(T.any(OpenAI::Models::CompletionChoice::Logprobs, OpenAI::Util::AnyHash))).void } + attr_writer :logprobs sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text sig do params( @@ -94,36 +71,28 @@ module OpenAI class Logprobs < OpenAI::BaseModel sig { returns(T.nilable(T::Array[Integer])) } - def text_offset - end + attr_reader :text_offset - sig { params(_: T::Array[Integer]).returns(T::Array[Integer]) } - def text_offset=(_) - end + sig { params(text_offset: T::Array[Integer]).void } + attr_writer :text_offset sig { returns(T.nilable(T::Array[Float])) } - def token_logprobs - end + attr_reader :token_logprobs - sig { params(_: T::Array[Float]).returns(T::Array[Float]) } - def token_logprobs=(_) - end + sig { params(token_logprobs: T::Array[Float]).void } + attr_writer :token_logprobs sig { returns(T.nilable(T::Array[String])) } - def tokens - end + attr_reader :tokens - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def tokens=(_) - end + sig { params(tokens: T::Array[String]).void } + attr_writer :tokens sig { returns(T.nilable(T::Array[T::Hash[Symbol, Float]])) } - def top_logprobs - end + attr_reader :top_logprobs - sig { params(_: T::Array[T::Hash[Symbol, Float]]).returns(T::Array[T::Hash[Symbol, Float]]) } - def top_logprobs=(_) - end + sig { params(top_logprobs: T::Array[T::Hash[Symbol, Float]]).void } + attr_writer :top_logprobs sig do params( diff --git a/rbi/lib/openai/models/completion_create_params.rbi b/rbi/lib/openai/models/completion_create_params.rbi index d2c76ed8..74e9a9a9 100644 --- a/rbi/lib/openai/models/completion_create_params.rbi +++ b/rbi/lib/openai/models/completion_create_params.rbi @@ -12,15 +12,7 @@ module OpenAI # [Model overview](https://platform.openai.com/docs/models) for descriptions of # them. sig { returns(T.any(String, OpenAI::Models::CompletionCreateParams::Model::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::CompletionCreateParams::Model::OrSymbol)) - .returns(T.any(String, OpenAI::Models::CompletionCreateParams::Model::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # The prompt(s) to generate completions for, encoded as a string, array of # strings, array of tokens, or array of token arrays. @@ -31,15 +23,7 @@ module OpenAI sig do returns(T.nilable(T.any(String, T::Array[String], T::Array[Integer], T::Array[T::Array[Integer]]))) end - def prompt - end - - sig do - params(_: T.nilable(T.any(String, T::Array[String], T::Array[Integer], T::Array[T::Array[Integer]]))) - .returns(T.nilable(T.any(String, T::Array[String], T::Array[Integer], T::Array[T::Array[Integer]]))) - end - def prompt=(_) - end + attr_accessor :prompt # Generates `best_of` completions server-side and returns the "best" (the one with # the highest log probability per token). Results cannot be streamed. @@ -51,21 +35,11 @@ module OpenAI # consume your token quota. Use carefully and ensure that you have reasonable # settings for `max_tokens` and `stop`. sig { returns(T.nilable(Integer)) } - def best_of - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def best_of=(_) - end + attr_accessor :best_of # Echo back the prompt in addition to the completion sig { returns(T.nilable(T::Boolean)) } - def echo - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def echo=(_) - end + attr_accessor :echo # Number between -2.0 and 2.0. Positive values penalize new tokens based on their # existing frequency in the text so far, decreasing the model's likelihood to @@ -73,12 +47,7 @@ module OpenAI # # [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) sig { returns(T.nilable(Float)) } - def frequency_penalty - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def frequency_penalty=(_) - end + attr_accessor :frequency_penalty # Modify the likelihood of specified tokens appearing in the completion. # @@ -93,12 +62,7 @@ module OpenAI # As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token # from being generated. sig { returns(T.nilable(T::Hash[Symbol, Integer])) } - def logit_bias - end - - sig { params(_: T.nilable(T::Hash[Symbol, Integer])).returns(T.nilable(T::Hash[Symbol, Integer])) } - def logit_bias=(_) - end + attr_accessor :logit_bias # Include the log probabilities on the `logprobs` most likely output tokens, as # well the chosen tokens. For example, if `logprobs` is 5, the API will return a @@ -107,12 +71,7 @@ module OpenAI # # The maximum value for `logprobs` is 5. sig { returns(T.nilable(Integer)) } - def logprobs - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def logprobs=(_) - end + attr_accessor :logprobs # The maximum number of [tokens](/tokenizer) that can be generated in the # completion. @@ -122,12 +81,7 @@ module OpenAI # [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) # for counting tokens. sig { returns(T.nilable(Integer)) } - def max_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_tokens=(_) - end + attr_accessor :max_tokens # How many completions to generate for each prompt. # @@ -135,12 +89,7 @@ module OpenAI # consume your token quota. Use carefully and ensure that you have reasonable # settings for `max_tokens` and `stop`. sig { returns(T.nilable(Integer)) } - def n - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def n=(_) - end + attr_accessor :n # Number between -2.0 and 2.0. Positive values penalize new tokens based on # whether they appear in the text so far, increasing the model's likelihood to @@ -148,12 +97,7 @@ module OpenAI # # [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) sig { returns(T.nilable(Float)) } - def presence_penalty - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def presence_penalty=(_) - end + attr_accessor :presence_penalty # If specified, our system will make a best effort to sample deterministically, # such that repeated requests with the same `seed` and parameters should return @@ -162,54 +106,30 @@ module OpenAI # Determinism is not guaranteed, and you should refer to the `system_fingerprint` # response parameter to monitor changes in the backend. sig { returns(T.nilable(Integer)) } - def seed - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def seed=(_) - end + attr_accessor :seed # Up to 4 sequences where the API will stop generating further tokens. The # returned text will not contain the stop sequence. sig { returns(T.nilable(T.any(String, T::Array[String]))) } - def stop - end - - sig do - params( - _: T.nilable( - T.any( - String, - T::Array[String] - ) - ) - ).returns(T.nilable(T.any(String, T::Array[String]))) - end - def stop=(_) - end + attr_accessor :stop # Options for streaming response. Only set this when you set `stream: true`. sig { returns(T.nilable(OpenAI::Models::Chat::ChatCompletionStreamOptions)) } - def stream_options - end + attr_reader :stream_options sig do - params(_: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionStreamOptions, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionStreamOptions, OpenAI::Util::AnyHash))) - end - def stream_options=(_) + params( + stream_options: T.nilable(T.any(OpenAI::Models::Chat::ChatCompletionStreamOptions, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :stream_options # The suffix that comes after a completion of inserted text. # # This parameter is only supported for `gpt-3.5-turbo-instruct`. sig { returns(T.nilable(String)) } - def suffix - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def suffix=(_) - end + attr_accessor :suffix # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more @@ -217,12 +137,7 @@ module OpenAI # # We generally recommend altering this or `top_p` but not both. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -230,23 +145,16 @@ module OpenAI # # We generally recommend altering this or `temperature` but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). sig { returns(T.nilable(String)) } - def user - end + attr_reader :user - sig { params(_: String).returns(String) } - def user=(_) - end + sig { params(user: String).void } + attr_writer :user sig do params( diff --git a/rbi/lib/openai/models/completion_usage.rbi b/rbi/lib/openai/models/completion_usage.rbi index d18a0c5d..bc7a3e80 100644 --- a/rbi/lib/openai/models/completion_usage.rbi +++ b/rbi/lib/openai/models/completion_usage.rbi @@ -5,54 +5,39 @@ module OpenAI class CompletionUsage < OpenAI::BaseModel # Number of tokens in the generated completion. sig { returns(Integer) } - def completion_tokens - end - - sig { params(_: Integer).returns(Integer) } - def completion_tokens=(_) - end + attr_accessor :completion_tokens # Number of tokens in the prompt. sig { returns(Integer) } - def prompt_tokens - end - - sig { params(_: Integer).returns(Integer) } - def prompt_tokens=(_) - end + attr_accessor :prompt_tokens # Total number of tokens used in the request (prompt + completion). sig { returns(Integer) } - def total_tokens - end - - sig { params(_: Integer).returns(Integer) } - def total_tokens=(_) - end + attr_accessor :total_tokens # Breakdown of tokens used in a completion. sig { returns(T.nilable(OpenAI::Models::CompletionUsage::CompletionTokensDetails)) } - def completion_tokens_details - end + attr_reader :completion_tokens_details sig do - params(_: T.any(OpenAI::Models::CompletionUsage::CompletionTokensDetails, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::CompletionUsage::CompletionTokensDetails, OpenAI::Util::AnyHash)) - end - def completion_tokens_details=(_) + params( + completion_tokens_details: T.any(OpenAI::Models::CompletionUsage::CompletionTokensDetails, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :completion_tokens_details # Breakdown of tokens used in the prompt. sig { returns(T.nilable(OpenAI::Models::CompletionUsage::PromptTokensDetails)) } - def prompt_tokens_details - end + attr_reader :prompt_tokens_details sig do - params(_: T.any(OpenAI::Models::CompletionUsage::PromptTokensDetails, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::CompletionUsage::PromptTokensDetails, OpenAI::Util::AnyHash)) - end - def prompt_tokens_details=(_) + params( + prompt_tokens_details: T.any(OpenAI::Models::CompletionUsage::PromptTokensDetails, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :prompt_tokens_details # Usage statistics for the completion request. sig do @@ -93,42 +78,34 @@ module OpenAI # When using Predicted Outputs, the number of tokens in the prediction that # appeared in the completion. sig { returns(T.nilable(Integer)) } - def accepted_prediction_tokens - end + attr_reader :accepted_prediction_tokens - sig { params(_: Integer).returns(Integer) } - def accepted_prediction_tokens=(_) - end + sig { params(accepted_prediction_tokens: Integer).void } + attr_writer :accepted_prediction_tokens # Audio input tokens generated by the model. sig { returns(T.nilable(Integer)) } - def audio_tokens - end + attr_reader :audio_tokens - sig { params(_: Integer).returns(Integer) } - def audio_tokens=(_) - end + sig { params(audio_tokens: Integer).void } + attr_writer :audio_tokens # Tokens generated by the model for reasoning. sig { returns(T.nilable(Integer)) } - def reasoning_tokens - end + attr_reader :reasoning_tokens - sig { params(_: Integer).returns(Integer) } - def reasoning_tokens=(_) - end + sig { params(reasoning_tokens: Integer).void } + attr_writer :reasoning_tokens # When using Predicted Outputs, the number of tokens in the prediction that did # not appear in the completion. However, like reasoning tokens, these tokens are # still counted in the total completion tokens for purposes of billing, output, # and context window limits. sig { returns(T.nilable(Integer)) } - def rejected_prediction_tokens - end + attr_reader :rejected_prediction_tokens - sig { params(_: Integer).returns(Integer) } - def rejected_prediction_tokens=(_) - end + sig { params(rejected_prediction_tokens: Integer).void } + attr_writer :rejected_prediction_tokens # Breakdown of tokens used in a completion. sig do @@ -161,21 +138,17 @@ module OpenAI class PromptTokensDetails < OpenAI::BaseModel # Audio input tokens present in the prompt. sig { returns(T.nilable(Integer)) } - def audio_tokens - end + attr_reader :audio_tokens - sig { params(_: Integer).returns(Integer) } - def audio_tokens=(_) - end + sig { params(audio_tokens: Integer).void } + attr_writer :audio_tokens # Cached tokens present in the prompt. sig { returns(T.nilable(Integer)) } - def cached_tokens - end + attr_reader :cached_tokens - sig { params(_: Integer).returns(Integer) } - def cached_tokens=(_) - end + sig { params(cached_tokens: Integer).void } + attr_writer :cached_tokens # Breakdown of tokens used in the prompt. sig { params(audio_tokens: Integer, cached_tokens: Integer).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/compound_filter.rbi b/rbi/lib/openai/models/compound_filter.rbi index eaf9891d..f36b780a 100644 --- a/rbi/lib/openai/models/compound_filter.rbi +++ b/rbi/lib/openai/models/compound_filter.rbi @@ -6,27 +6,11 @@ module OpenAI # Array of filters to combine. Items can be `ComparisonFilter` or # `CompoundFilter`. sig { returns(T::Array[T.any(OpenAI::Models::ComparisonFilter, T.anything)]) } - def filters - end - - sig do - params(_: T::Array[T.any(OpenAI::Models::ComparisonFilter, T.anything)]) - .returns(T::Array[T.any(OpenAI::Models::ComparisonFilter, T.anything)]) - end - def filters=(_) - end + attr_accessor :filters # Type of operation: `and` or `or`. sig { returns(OpenAI::Models::CompoundFilter::Type::OrSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::CompoundFilter::Type::OrSymbol) - .returns(OpenAI::Models::CompoundFilter::Type::OrSymbol) - end - def type=(_) - end + attr_accessor :type # Combine multiple filters using `and` or `or`. sig do diff --git a/rbi/lib/openai/models/create_embedding_response.rbi b/rbi/lib/openai/models/create_embedding_response.rbi index e9a4af7f..d057718b 100644 --- a/rbi/lib/openai/models/create_embedding_response.rbi +++ b/rbi/lib/openai/models/create_embedding_response.rbi @@ -5,42 +5,22 @@ module OpenAI class CreateEmbeddingResponse < OpenAI::BaseModel # The list of embeddings generated by the model. sig { returns(T::Array[OpenAI::Models::Embedding]) } - def data - end - - sig { params(_: T::Array[OpenAI::Models::Embedding]).returns(T::Array[OpenAI::Models::Embedding]) } - def data=(_) - end + attr_accessor :data # The name of the model used to generate the embedding. sig { returns(String) } - def model - end - - sig { params(_: String).returns(String) } - def model=(_) - end + attr_accessor :model # The object type, which is always "list". sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The usage information for the request. sig { returns(OpenAI::Models::CreateEmbeddingResponse::Usage) } - def usage - end + attr_reader :usage - sig do - params(_: T.any(OpenAI::Models::CreateEmbeddingResponse::Usage, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::CreateEmbeddingResponse::Usage, OpenAI::Util::AnyHash)) - end - def usage=(_) - end + sig { params(usage: T.any(OpenAI::Models::CreateEmbeddingResponse::Usage, OpenAI::Util::AnyHash)).void } + attr_writer :usage sig do params( @@ -71,21 +51,11 @@ module OpenAI class Usage < OpenAI::BaseModel # The number of tokens used by the prompt. sig { returns(Integer) } - def prompt_tokens - end - - sig { params(_: Integer).returns(Integer) } - def prompt_tokens=(_) - end + attr_accessor :prompt_tokens # The total number of tokens used by the request. sig { returns(Integer) } - def total_tokens - end - - sig { params(_: Integer).returns(Integer) } - def total_tokens=(_) - end + attr_accessor :total_tokens # The usage information for the request. sig { params(prompt_tokens: Integer, total_tokens: Integer).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/embedding.rbi b/rbi/lib/openai/models/embedding.rbi index 4218f3b9..90ad0f45 100644 --- a/rbi/lib/openai/models/embedding.rbi +++ b/rbi/lib/openai/models/embedding.rbi @@ -7,30 +7,15 @@ module OpenAI # the model as listed in the # [embedding guide](https://platform.openai.com/docs/guides/embeddings). sig { returns(T::Array[Float]) } - def embedding - end - - sig { params(_: T::Array[Float]).returns(T::Array[Float]) } - def embedding=(_) - end + attr_accessor :embedding # The index of the embedding in the list of embeddings. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The object type, which is always "embedding". sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # Represents an embedding vector returned by embedding endpoint. sig { params(embedding: T::Array[Float], index: Integer, object: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/embedding_create_params.rbi b/rbi/lib/openai/models/embedding_create_params.rbi index 69cd0415..0f90d8b7 100644 --- a/rbi/lib/openai/models/embedding_create_params.rbi +++ b/rbi/lib/openai/models/embedding_create_params.rbi @@ -15,15 +15,7 @@ module OpenAI # for counting tokens. Some models may also impose a limit on total number of # tokens summed across inputs. sig { returns(T.any(String, T::Array[String], T::Array[Integer], T::Array[T::Array[Integer]])) } - def input - end - - sig do - params(_: T.any(String, T::Array[String], T::Array[Integer], T::Array[T::Array[Integer]])) - .returns(T.any(String, T::Array[String], T::Array[Integer], T::Array[T::Array[Integer]])) - end - def input=(_) - end + attr_accessor :input # ID of the model to use. You can use the # [List models](https://platform.openai.com/docs/api-reference/models/list) API to @@ -31,49 +23,32 @@ module OpenAI # [Model overview](https://platform.openai.com/docs/models) for descriptions of # them. sig { returns(T.any(String, OpenAI::Models::EmbeddingModel::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::EmbeddingModel::OrSymbol)) - .returns(T.any(String, OpenAI::Models::EmbeddingModel::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # The number of dimensions the resulting output embeddings should have. Only # supported in `text-embedding-3` and later models. sig { returns(T.nilable(Integer)) } - def dimensions - end + attr_reader :dimensions - sig { params(_: Integer).returns(Integer) } - def dimensions=(_) - end + sig { params(dimensions: Integer).void } + attr_writer :dimensions # The format to return the embeddings in. Can be either `float` or # [`base64`](https://pypi.org/project/pybase64/). sig { returns(T.nilable(OpenAI::Models::EmbeddingCreateParams::EncodingFormat::OrSymbol)) } - def encoding_format - end + attr_reader :encoding_format - sig do - params(_: OpenAI::Models::EmbeddingCreateParams::EncodingFormat::OrSymbol) - .returns(OpenAI::Models::EmbeddingCreateParams::EncodingFormat::OrSymbol) - end - def encoding_format=(_) - end + sig { params(encoding_format: OpenAI::Models::EmbeddingCreateParams::EncodingFormat::OrSymbol).void } + attr_writer :encoding_format # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). sig { returns(T.nilable(String)) } - def user - end + attr_reader :user - sig { params(_: String).returns(String) } - def user=(_) - end + sig { params(user: String).void } + attr_writer :user sig do params( diff --git a/rbi/lib/openai/models/error_object.rbi b/rbi/lib/openai/models/error_object.rbi index f7390e71..134b6d66 100644 --- a/rbi/lib/openai/models/error_object.rbi +++ b/rbi/lib/openai/models/error_object.rbi @@ -4,36 +4,16 @@ module OpenAI module Models class ErrorObject < OpenAI::BaseModel sig { returns(T.nilable(String)) } - def code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def code=(_) - end + attr_accessor :code sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message sig { returns(T.nilable(String)) } - def param - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def param=(_) - end + attr_accessor :param sig { returns(String) } - def type - end - - sig { params(_: String).returns(String) } - def type=(_) - end + attr_accessor :type sig do params(code: T.nilable(String), message: String, param: T.nilable(String), type: String) diff --git a/rbi/lib/openai/models/file_create_params.rbi b/rbi/lib/openai/models/file_create_params.rbi index 93746f38..c25ae968 100644 --- a/rbi/lib/openai/models/file_create_params.rbi +++ b/rbi/lib/openai/models/file_create_params.rbi @@ -8,24 +8,14 @@ module OpenAI # The File object (not file name) to be uploaded. sig { returns(T.any(IO, StringIO)) } - def file - end - - sig { params(_: T.any(IO, StringIO)).returns(T.any(IO, StringIO)) } - def file=(_) - end + attr_accessor :file # The intended purpose of the uploaded file. One of: - `assistants`: Used in the # Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for # fine-tuning - `vision`: Images used for vision fine-tuning - `user_data`: # Flexible file type for any purpose - `evals`: Used for eval data sets sig { returns(OpenAI::Models::FilePurpose::OrSymbol) } - def purpose - end - - sig { params(_: OpenAI::Models::FilePurpose::OrSymbol).returns(OpenAI::Models::FilePurpose::OrSymbol) } - def purpose=(_) - end + attr_accessor :purpose sig do params( diff --git a/rbi/lib/openai/models/file_deleted.rbi b/rbi/lib/openai/models/file_deleted.rbi index 83029526..fd6fac2b 100644 --- a/rbi/lib/openai/models/file_deleted.rbi +++ b/rbi/lib/openai/models/file_deleted.rbi @@ -4,28 +4,13 @@ module OpenAI module Models class FileDeleted < OpenAI::BaseModel sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id sig { returns(T::Boolean) } - def deleted - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def deleted=(_) - end + attr_accessor :deleted sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } def self.new(id:, deleted:, object: :file) diff --git a/rbi/lib/openai/models/file_list_params.rbi b/rbi/lib/openai/models/file_list_params.rbi index 795e6044..7cf867a4 100644 --- a/rbi/lib/openai/models/file_list_params.rbi +++ b/rbi/lib/openai/models/file_list_params.rbi @@ -11,44 +11,33 @@ module OpenAI # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A limit on the number of objects to be returned. Limit can range between 1 and # 10,000, and the default is 10,000. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order by the `created_at` timestamp of the objects. `asc` for ascending # order and `desc` for descending order. sig { returns(T.nilable(OpenAI::Models::FileListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::FileListParams::Order::OrSymbol) - .returns(OpenAI::Models::FileListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::FileListParams::Order::OrSymbol).void } + attr_writer :order # Only return files with the given purpose. sig { returns(T.nilable(String)) } - def purpose - end + attr_reader :purpose - sig { params(_: String).returns(String) } - def purpose=(_) - end + sig { params(purpose: String).void } + attr_writer :purpose sig do params( diff --git a/rbi/lib/openai/models/file_object.rbi b/rbi/lib/openai/models/file_object.rbi index 00ace88e..85e51b7d 100644 --- a/rbi/lib/openai/models/file_object.rbi +++ b/rbi/lib/openai/models/file_object.rbi @@ -5,94 +5,49 @@ module OpenAI class FileObject < OpenAI::BaseModel # The file identifier, which can be referenced in the API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The size of the file, in bytes. sig { returns(Integer) } - def bytes - end - - sig { params(_: Integer).returns(Integer) } - def bytes=(_) - end + attr_accessor :bytes # The Unix timestamp (in seconds) for when the file was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The name of the file. sig { returns(String) } - def filename - end - - sig { params(_: String).returns(String) } - def filename=(_) - end + attr_accessor :filename # The object type, which is always `file`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The intended purpose of the file. Supported values are `assistants`, # `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` # and `vision`. sig { returns(OpenAI::Models::FileObject::Purpose::TaggedSymbol) } - def purpose - end - - sig do - params(_: OpenAI::Models::FileObject::Purpose::TaggedSymbol) - .returns(OpenAI::Models::FileObject::Purpose::TaggedSymbol) - end - def purpose=(_) - end + attr_accessor :purpose # Deprecated. The current status of the file, which can be either `uploaded`, # `processed`, or `error`. sig { returns(OpenAI::Models::FileObject::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::FileObject::Status::TaggedSymbol) - .returns(OpenAI::Models::FileObject::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The Unix timestamp (in seconds) for when the file will expire. sig { returns(T.nilable(Integer)) } - def expires_at - end + attr_reader :expires_at - sig { params(_: Integer).returns(Integer) } - def expires_at=(_) - end + sig { params(expires_at: Integer).void } + attr_writer :expires_at # Deprecated. For details on why a fine-tuning training file failed validation, # see the `error` field on `fine_tuning.job`. sig { returns(T.nilable(String)) } - def status_details - end + attr_reader :status_details - sig { params(_: String).returns(String) } - def status_details=(_) - end + sig { params(status_details: String).void } + attr_writer :status_details # The `File` object represents a document that has been uploaded to OpenAI. sig do diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi b/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi index 04cf51bd..b7a0df18 100644 --- a/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi +++ b/rbi/lib/openai/models/fine_tuning/fine_tuning_job.rbi @@ -6,180 +6,97 @@ module OpenAI class FineTuningJob < OpenAI::BaseModel # The object identifier, which can be referenced in the API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the fine-tuning job was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # For fine-tuning jobs that have `failed`, this will contain more information on # the cause of the failure. sig { returns(T.nilable(OpenAI::Models::FineTuning::FineTuningJob::Error)) } - def error - end + attr_reader :error sig do - params(_: T.nilable(T.any(OpenAI::Models::FineTuning::FineTuningJob::Error, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::FineTuning::FineTuningJob::Error, OpenAI::Util::AnyHash))) - end - def error=(_) + params(error: T.nilable(T.any(OpenAI::Models::FineTuning::FineTuningJob::Error, OpenAI::Util::AnyHash))) + .void end + attr_writer :error # The name of the fine-tuned model that is being created. The value will be null # if the fine-tuning job is still running. sig { returns(T.nilable(String)) } - def fine_tuned_model - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def fine_tuned_model=(_) - end + attr_accessor :fine_tuned_model # The Unix timestamp (in seconds) for when the fine-tuning job was finished. The # value will be null if the fine-tuning job is still running. sig { returns(T.nilable(Integer)) } - def finished_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def finished_at=(_) - end + attr_accessor :finished_at # The hyperparameters used for the fine-tuning job. This value will only be # returned when running `supervised` jobs. sig { returns(OpenAI::Models::FineTuning::FineTuningJob::Hyperparameters) } - def hyperparameters - end + attr_reader :hyperparameters sig do - params(_: T.any(OpenAI::Models::FineTuning::FineTuningJob::Hyperparameters, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::FineTuningJob::Hyperparameters, OpenAI::Util::AnyHash)) - end - def hyperparameters=(_) + params( + hyperparameters: T.any(OpenAI::Models::FineTuning::FineTuningJob::Hyperparameters, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :hyperparameters # The base model that is being fine-tuned. sig { returns(String) } - def model - end - - sig { params(_: String).returns(String) } - def model=(_) - end + attr_accessor :model # The object type, which is always "fine_tuning.job". sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The organization that owns the fine-tuning job. sig { returns(String) } - def organization_id - end - - sig { params(_: String).returns(String) } - def organization_id=(_) - end + attr_accessor :organization_id # The compiled results file ID(s) for the fine-tuning job. You can retrieve the # results with the # [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). sig { returns(T::Array[String]) } - def result_files - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def result_files=(_) - end + attr_accessor :result_files # The seed used for the fine-tuning job. sig { returns(Integer) } - def seed - end - - sig { params(_: Integer).returns(Integer) } - def seed=(_) - end + attr_accessor :seed # The current status of the fine-tuning job, which can be either # `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. sig { returns(OpenAI::Models::FineTuning::FineTuningJob::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::FineTuning::FineTuningJob::Status::TaggedSymbol) - .returns(OpenAI::Models::FineTuning::FineTuningJob::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The total number of billable tokens processed by this fine-tuning job. The value # will be null if the fine-tuning job is still running. sig { returns(T.nilable(Integer)) } - def trained_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def trained_tokens=(_) - end + attr_accessor :trained_tokens # The file ID used for training. You can retrieve the training data with the # [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). sig { returns(String) } - def training_file - end - - sig { params(_: String).returns(String) } - def training_file=(_) - end + attr_accessor :training_file # The file ID used for validation. You can retrieve the validation results with # the # [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). sig { returns(T.nilable(String)) } - def validation_file - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def validation_file=(_) - end + attr_accessor :validation_file # The Unix timestamp (in seconds) for when the fine-tuning job is estimated to # finish. The value will be null if the fine-tuning job is not running. sig { returns(T.nilable(Integer)) } - def estimated_finish - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def estimated_finish=(_) - end + attr_accessor :estimated_finish # A list of integrations to enable for this fine-tuning job. sig { returns(T.nilable(T::Array[OpenAI::Models::FineTuning::FineTuningJobWandbIntegrationObject])) } - def integrations - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::FineTuning::FineTuningJobWandbIntegrationObject])) - .returns(T.nilable(T::Array[OpenAI::Models::FineTuning::FineTuningJobWandbIntegrationObject])) - end - def integrations=(_) - end + attr_accessor :integrations # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -188,24 +105,14 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The method used for fine-tuning. sig { returns(T.nilable(OpenAI::Models::FineTuning::FineTuningJob::Method)) } - def method_ - end + attr_reader :method_ - sig do - params(_: T.any(OpenAI::Models::FineTuning::FineTuningJob::Method, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::FineTuningJob::Method, OpenAI::Util::AnyHash)) - end - def method_=(_) - end + sig { params(method_: T.any(OpenAI::Models::FineTuning::FineTuningJob::Method, OpenAI::Util::AnyHash)).void } + attr_writer :method_ # The `fine_tuning.job` object represents a fine-tuning job that has been created # through the API. @@ -290,31 +197,16 @@ module OpenAI class Error < OpenAI::BaseModel # A machine-readable error code. sig { returns(String) } - def code - end - - sig { params(_: String).returns(String) } - def code=(_) - end + attr_accessor :code # A human-readable error message. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # The parameter that was invalid, usually `training_file` or `validation_file`. # This field will be null if the failure was not parameter-specific. sig { returns(T.nilable(String)) } - def param - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def param=(_) - end + attr_accessor :param # For fine-tuning jobs that have `failed`, this will contain more information on # the cause of the failure. @@ -331,32 +223,26 @@ module OpenAI # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def batch_size - end + attr_reader :batch_size - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def batch_size=(_) - end + sig { params(batch_size: T.any(Symbol, Integer)).void } + attr_writer :batch_size # Scaling factor for the learning rate. A smaller learning rate may be useful to # avoid overfitting. sig { returns(T.nilable(T.any(Symbol, Float))) } - def learning_rate_multiplier - end + attr_reader :learning_rate_multiplier - sig { params(_: T.any(Symbol, Float)).returns(T.any(Symbol, Float)) } - def learning_rate_multiplier=(_) - end + sig { params(learning_rate_multiplier: T.any(Symbol, Float)).void } + attr_writer :learning_rate_multiplier # The number of epochs to train the model for. An epoch refers to one full cycle # through the training dataset. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def n_epochs - end + attr_reader :n_epochs - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def n_epochs=(_) - end + sig { params(n_epochs: T.any(Symbol, Integer)).void } + attr_writer :n_epochs # The hyperparameters used for the fine-tuning job. This value will only be # returned when running `supervised` jobs. @@ -454,39 +340,29 @@ module OpenAI class Method < OpenAI::BaseModel # Configuration for the DPO fine-tuning method. sig { returns(T.nilable(OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo)) } - def dpo - end + attr_reader :dpo - sig do - params(_: T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo, OpenAI::Util::AnyHash)) - end - def dpo=(_) - end + sig { params(dpo: T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo, OpenAI::Util::AnyHash)).void } + attr_writer :dpo # Configuration for the supervised fine-tuning method. sig { returns(T.nilable(OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised)) } - def supervised - end + attr_reader :supervised sig do - params(_: T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised, OpenAI::Util::AnyHash)) - end - def supervised=(_) + params( + supervised: T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :supervised # The type of method. Is either `supervised` or `dpo`. sig { returns(T.nilable(OpenAI::Models::FineTuning::FineTuningJob::Method::Type::TaggedSymbol)) } - def type - end + attr_reader :type - sig do - params(_: OpenAI::Models::FineTuning::FineTuningJob::Method::Type::OrSymbol) - .returns(OpenAI::Models::FineTuning::FineTuningJob::Method::Type::OrSymbol) - end - def type=(_) - end + sig { params(type: OpenAI::Models::FineTuning::FineTuningJob::Method::Type::OrSymbol).void } + attr_writer :type # The method used for fine-tuning. sig do @@ -516,19 +392,15 @@ module OpenAI class Dpo < OpenAI::BaseModel # The hyperparameters used for the fine-tuning job. sig { returns(T.nilable(OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters)) } - def hyperparameters - end + attr_reader :hyperparameters sig do params( - _: T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters, OpenAI::Util::AnyHash) + hyperparameters: T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::FineTuning::FineTuningJob::Method::Dpo::Hyperparameters, OpenAI::Util::AnyHash) - ) - end - def hyperparameters=(_) + .void end + attr_writer :hyperparameters # Configuration for the DPO fine-tuning method. sig do @@ -551,42 +423,34 @@ module OpenAI # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def batch_size - end + attr_reader :batch_size - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def batch_size=(_) - end + sig { params(batch_size: T.any(Symbol, Integer)).void } + attr_writer :batch_size # The beta value for the DPO method. A higher beta value will increase the weight # of the penalty between the policy and reference model. sig { returns(T.nilable(T.any(Symbol, Float))) } - def beta - end + attr_reader :beta - sig { params(_: T.any(Symbol, Float)).returns(T.any(Symbol, Float)) } - def beta=(_) - end + sig { params(beta: T.any(Symbol, Float)).void } + attr_writer :beta # Scaling factor for the learning rate. A smaller learning rate may be useful to # avoid overfitting. sig { returns(T.nilable(T.any(Symbol, Float))) } - def learning_rate_multiplier - end + attr_reader :learning_rate_multiplier - sig { params(_: T.any(Symbol, Float)).returns(T.any(Symbol, Float)) } - def learning_rate_multiplier=(_) - end + sig { params(learning_rate_multiplier: T.any(Symbol, Float)).void } + attr_writer :learning_rate_multiplier # The number of epochs to train the model for. An epoch refers to one full cycle # through the training dataset. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def n_epochs - end + attr_reader :n_epochs - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def n_epochs=(_) - end + sig { params(n_epochs: T.any(Symbol, Integer)).void } + attr_writer :n_epochs # The hyperparameters used for the fine-tuning job. sig do @@ -676,25 +540,18 @@ module OpenAI class Supervised < OpenAI::BaseModel # The hyperparameters used for the fine-tuning job. sig { returns(T.nilable(OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised::Hyperparameters)) } - def hyperparameters - end + attr_reader :hyperparameters sig do params( - _: T.any( + hyperparameters: T.any( OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised::Hyperparameters, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::FineTuning::FineTuningJob::Method::Supervised::Hyperparameters, - OpenAI::Util::AnyHash - ) - ) - end - def hyperparameters=(_) + .void end + attr_writer :hyperparameters # Configuration for the supervised fine-tuning method. sig do @@ -720,32 +577,26 @@ module OpenAI # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def batch_size - end + attr_reader :batch_size - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def batch_size=(_) - end + sig { params(batch_size: T.any(Symbol, Integer)).void } + attr_writer :batch_size # Scaling factor for the learning rate. A smaller learning rate may be useful to # avoid overfitting. sig { returns(T.nilable(T.any(Symbol, Float))) } - def learning_rate_multiplier - end + attr_reader :learning_rate_multiplier - sig { params(_: T.any(Symbol, Float)).returns(T.any(Symbol, Float)) } - def learning_rate_multiplier=(_) - end + sig { params(learning_rate_multiplier: T.any(Symbol, Float)).void } + attr_writer :learning_rate_multiplier # The number of epochs to train the model for. An epoch refers to one full cycle # through the training dataset. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def n_epochs - end + attr_reader :n_epochs - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def n_epochs=(_) - end + sig { params(n_epochs: T.any(Symbol, Integer)).void } + attr_writer :n_epochs # The hyperparameters used for the fine-tuning job. sig do diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi index 372492b9..61fee31f 100644 --- a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi +++ b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_event.rbi @@ -6,72 +6,37 @@ module OpenAI class FineTuningJobEvent < OpenAI::BaseModel # The object identifier. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the fine-tuning job was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The log level of the event. sig { returns(OpenAI::Models::FineTuning::FineTuningJobEvent::Level::TaggedSymbol) } - def level - end - - sig do - params(_: OpenAI::Models::FineTuning::FineTuningJobEvent::Level::TaggedSymbol) - .returns(OpenAI::Models::FineTuning::FineTuningJobEvent::Level::TaggedSymbol) - end - def level=(_) - end + attr_accessor :level # The message of the event. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # The object type, which is always "fine_tuning.job.event". sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The data associated with the event. sig { returns(T.nilable(T.anything)) } - def data - end + attr_reader :data - sig { params(_: T.anything).returns(T.anything) } - def data=(_) - end + sig { params(data: T.anything).void } + attr_writer :data # The type of event. sig { returns(T.nilable(OpenAI::Models::FineTuning::FineTuningJobEvent::Type::TaggedSymbol)) } - def type - end + attr_reader :type - sig do - params(_: OpenAI::Models::FineTuning::FineTuningJobEvent::Type::OrSymbol) - .returns(OpenAI::Models::FineTuning::FineTuningJobEvent::Type::OrSymbol) - end - def type=(_) - end + sig { params(type: OpenAI::Models::FineTuning::FineTuningJobEvent::Type::OrSymbol).void } + attr_writer :type # Fine-tuning job event object sig do diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi index 22879caa..315342d0 100644 --- a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi +++ b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration.rbi @@ -6,44 +6,27 @@ module OpenAI class FineTuningJobWandbIntegration < OpenAI::BaseModel # The name of the project that the new run will be created under. sig { returns(String) } - def project - end - - sig { params(_: String).returns(String) } - def project=(_) - end + attr_accessor :project # The entity to use for the run. This allows you to set the team or username of # the WandB user that you would like associated with the run. If not set, the # default entity for the registered WandB API key is used. sig { returns(T.nilable(String)) } - def entity - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def entity=(_) - end + attr_accessor :entity # A display name to set for the run. If not set, we will use the Job ID as the # name. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name # A list of tags to be attached to the newly created run. These tags are passed # through directly to WandB. Some default tags are generated by OpenAI: # "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". sig { returns(T.nilable(T::Array[String])) } - def tags - end + attr_reader :tags - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def tags=(_) - end + sig { params(tags: T::Array[String]).void } + attr_writer :tags # The settings for your integration with Weights and Biases. This payload # specifies the project that metrics will be sent to. Optionally, you can set an diff --git a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi index de6aec82..79b69c52 100644 --- a/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi +++ b/rbi/lib/openai/models/fine_tuning/fine_tuning_job_wandb_integration_object.rbi @@ -6,27 +6,17 @@ module OpenAI class FineTuningJobWandbIntegrationObject < OpenAI::BaseModel # The type of the integration being enabled for the fine-tuning job sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The settings for your integration with Weights and Biases. This payload # specifies the project that metrics will be sent to. Optionally, you can set an # explicit display name for your run, add tags to your run, and set a default # entity (team, username, etc) to be associated with your run. sig { returns(OpenAI::Models::FineTuning::FineTuningJobWandbIntegration) } - def wandb - end + attr_reader :wandb - sig do - params(_: T.any(OpenAI::Models::FineTuning::FineTuningJobWandbIntegration, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::FineTuningJobWandbIntegration, OpenAI::Util::AnyHash)) - end - def wandb=(_) - end + sig { params(wandb: T.any(OpenAI::Models::FineTuning::FineTuningJobWandbIntegration, OpenAI::Util::AnyHash)).void } + attr_writer :wandb sig do params( diff --git a/rbi/lib/openai/models/fine_tuning/job_create_params.rbi b/rbi/lib/openai/models/fine_tuning/job_create_params.rbi index 5c524237..d9c7959b 100644 --- a/rbi/lib/openai/models/fine_tuning/job_create_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/job_create_params.rbi @@ -10,15 +10,7 @@ module OpenAI # The name of the model to fine-tune. You can select one of the # [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned). sig { returns(T.any(String, OpenAI::Models::FineTuning::JobCreateParams::Model::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::FineTuning::JobCreateParams::Model::OrSymbol)) - .returns(T.any(String, OpenAI::Models::FineTuning::JobCreateParams::Model::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # The ID of an uploaded file that contains training data. # @@ -38,37 +30,24 @@ module OpenAI # See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) # for more details. sig { returns(String) } - def training_file - end - - sig { params(_: String).returns(String) } - def training_file=(_) - end + attr_accessor :training_file # The hyperparameters used for the fine-tuning job. This value is now deprecated # in favor of `method`, and should be passed in under the `method` parameter. sig { returns(T.nilable(OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters)) } - def hyperparameters - end + attr_reader :hyperparameters sig do - params(_: T.any(OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters, OpenAI::Util::AnyHash)) - end - def hyperparameters=(_) + params( + hyperparameters: T.any(OpenAI::Models::FineTuning::JobCreateParams::Hyperparameters, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :hyperparameters # A list of integrations to enable for your fine-tuning job. sig { returns(T.nilable(T::Array[OpenAI::Models::FineTuning::JobCreateParams::Integration])) } - def integrations - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::FineTuning::JobCreateParams::Integration])) - .returns(T.nilable(T::Array[OpenAI::Models::FineTuning::JobCreateParams::Integration])) - end - def integrations=(_) - end + attr_accessor :integrations # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -77,35 +56,20 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The method used for fine-tuning. sig { returns(T.nilable(OpenAI::Models::FineTuning::JobCreateParams::Method)) } - def method_ - end + attr_reader :method_ - sig do - params(_: T.any(OpenAI::Models::FineTuning::JobCreateParams::Method, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::JobCreateParams::Method, OpenAI::Util::AnyHash)) - end - def method_=(_) - end + sig { params(method_: T.any(OpenAI::Models::FineTuning::JobCreateParams::Method, OpenAI::Util::AnyHash)).void } + attr_writer :method_ # The seed controls the reproducibility of the job. Passing in the same seed and # job parameters should produce the same results, but may differ in rare cases. If # a seed is not specified, one will be generated for you. sig { returns(T.nilable(Integer)) } - def seed - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def seed=(_) - end + attr_accessor :seed # A string of up to 64 characters that will be added to your fine-tuned model # name. @@ -113,12 +77,7 @@ module OpenAI # For example, a `suffix` of "custom-model-name" would produce a model name like # `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. sig { returns(T.nilable(String)) } - def suffix - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def suffix=(_) - end + attr_accessor :suffix # The ID of an uploaded file that contains validation data. # @@ -133,12 +92,7 @@ module OpenAI # See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) # for more details. sig { returns(T.nilable(String)) } - def validation_file - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def validation_file=(_) - end + attr_accessor :validation_file sig do params( @@ -219,32 +173,26 @@ module OpenAI # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def batch_size - end + attr_reader :batch_size - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def batch_size=(_) - end + sig { params(batch_size: T.any(Symbol, Integer)).void } + attr_writer :batch_size # Scaling factor for the learning rate. A smaller learning rate may be useful to # avoid overfitting. sig { returns(T.nilable(T.any(Symbol, Float))) } - def learning_rate_multiplier - end + attr_reader :learning_rate_multiplier - sig { params(_: T.any(Symbol, Float)).returns(T.any(Symbol, Float)) } - def learning_rate_multiplier=(_) - end + sig { params(learning_rate_multiplier: T.any(Symbol, Float)).void } + attr_writer :learning_rate_multiplier # The number of epochs to train the model for. An epoch refers to one full cycle # through the training dataset. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def n_epochs - end + attr_reader :n_epochs - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def n_epochs=(_) - end + sig { params(n_epochs: T.any(Symbol, Integer)).void } + attr_writer :n_epochs # The hyperparameters used for the fine-tuning job. This value is now deprecated # in favor of `method`, and should be passed in under the `method` parameter. @@ -319,27 +267,22 @@ module OpenAI # The type of integration to enable. Currently, only "wandb" (Weights and Biases) # is supported. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The settings for your integration with Weights and Biases. This payload # specifies the project that metrics will be sent to. Optionally, you can set an # explicit display name for your run, add tags to your run, and set a default # entity (team, username, etc) to be associated with your run. sig { returns(OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb) } - def wandb - end + attr_reader :wandb sig do - params(_: T.any(OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb, OpenAI::Util::AnyHash)) - end - def wandb=(_) + params( + wandb: T.any(OpenAI::Models::FineTuning::JobCreateParams::Integration::Wandb, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :wandb sig do params( @@ -358,44 +301,27 @@ module OpenAI class Wandb < OpenAI::BaseModel # The name of the project that the new run will be created under. sig { returns(String) } - def project - end - - sig { params(_: String).returns(String) } - def project=(_) - end + attr_accessor :project # The entity to use for the run. This allows you to set the team or username of # the WandB user that you would like associated with the run. If not set, the # default entity for the registered WandB API key is used. sig { returns(T.nilable(String)) } - def entity - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def entity=(_) - end + attr_accessor :entity # A display name to set for the run. If not set, we will use the Job ID as the # name. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name # A list of tags to be attached to the newly created run. These tags are passed # through directly to WandB. Some default tags are generated by OpenAI: # "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". sig { returns(T.nilable(T::Array[String])) } - def tags - end + attr_reader :tags - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def tags=(_) - end + sig { params(tags: T::Array[String]).void } + attr_writer :tags # The settings for your integration with Weights and Biases. This payload # specifies the project that metrics will be sent to. Optionally, you can set an @@ -430,39 +356,29 @@ module OpenAI class Method < OpenAI::BaseModel # Configuration for the DPO fine-tuning method. sig { returns(T.nilable(OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo)) } - def dpo - end + attr_reader :dpo - sig do - params(_: T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo, OpenAI::Util::AnyHash)) - end - def dpo=(_) - end + sig { params(dpo: T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo, OpenAI::Util::AnyHash)).void } + attr_writer :dpo # Configuration for the supervised fine-tuning method. sig { returns(T.nilable(OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised)) } - def supervised - end + attr_reader :supervised sig do - params(_: T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised, OpenAI::Util::AnyHash)) - end - def supervised=(_) + params( + supervised: T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :supervised # The type of method. Is either `supervised` or `dpo`. sig { returns(T.nilable(OpenAI::Models::FineTuning::JobCreateParams::Method::Type::OrSymbol)) } - def type - end + attr_reader :type - sig do - params(_: OpenAI::Models::FineTuning::JobCreateParams::Method::Type::OrSymbol) - .returns(OpenAI::Models::FineTuning::JobCreateParams::Method::Type::OrSymbol) - end - def type=(_) - end + sig { params(type: OpenAI::Models::FineTuning::JobCreateParams::Method::Type::OrSymbol).void } + attr_writer :type # The method used for fine-tuning. sig do @@ -492,19 +408,15 @@ module OpenAI class Dpo < OpenAI::BaseModel # The hyperparameters used for the fine-tuning job. sig { returns(T.nilable(OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters)) } - def hyperparameters - end + attr_reader :hyperparameters sig do params( - _: T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters, OpenAI::Util::AnyHash) + hyperparameters: T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters, OpenAI::Util::AnyHash) ) - .returns( - T.any(OpenAI::Models::FineTuning::JobCreateParams::Method::Dpo::Hyperparameters, OpenAI::Util::AnyHash) - ) - end - def hyperparameters=(_) + .void end + attr_writer :hyperparameters # Configuration for the DPO fine-tuning method. sig do @@ -527,42 +439,34 @@ module OpenAI # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def batch_size - end + attr_reader :batch_size - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def batch_size=(_) - end + sig { params(batch_size: T.any(Symbol, Integer)).void } + attr_writer :batch_size # The beta value for the DPO method. A higher beta value will increase the weight # of the penalty between the policy and reference model. sig { returns(T.nilable(T.any(Symbol, Float))) } - def beta - end + attr_reader :beta - sig { params(_: T.any(Symbol, Float)).returns(T.any(Symbol, Float)) } - def beta=(_) - end + sig { params(beta: T.any(Symbol, Float)).void } + attr_writer :beta # Scaling factor for the learning rate. A smaller learning rate may be useful to # avoid overfitting. sig { returns(T.nilable(T.any(Symbol, Float))) } - def learning_rate_multiplier - end + attr_reader :learning_rate_multiplier - sig { params(_: T.any(Symbol, Float)).returns(T.any(Symbol, Float)) } - def learning_rate_multiplier=(_) - end + sig { params(learning_rate_multiplier: T.any(Symbol, Float)).void } + attr_writer :learning_rate_multiplier # The number of epochs to train the model for. An epoch refers to one full cycle # through the training dataset. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def n_epochs - end + attr_reader :n_epochs - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def n_epochs=(_) - end + sig { params(n_epochs: T.any(Symbol, Integer)).void } + attr_writer :n_epochs # The hyperparameters used for the fine-tuning job. sig do @@ -652,25 +556,18 @@ module OpenAI class Supervised < OpenAI::BaseModel # The hyperparameters used for the fine-tuning job. sig { returns(T.nilable(OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised::Hyperparameters)) } - def hyperparameters - end + attr_reader :hyperparameters sig do params( - _: T.any( + hyperparameters: T.any( OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised::Hyperparameters, OpenAI::Util::AnyHash ) ) - .returns( - T.any( - OpenAI::Models::FineTuning::JobCreateParams::Method::Supervised::Hyperparameters, - OpenAI::Util::AnyHash - ) - ) - end - def hyperparameters=(_) + .void end + attr_writer :hyperparameters # Configuration for the supervised fine-tuning method. sig do @@ -698,32 +595,26 @@ module OpenAI # Number of examples in each batch. A larger batch size means that model # parameters are updated less frequently, but with lower variance. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def batch_size - end + attr_reader :batch_size - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def batch_size=(_) - end + sig { params(batch_size: T.any(Symbol, Integer)).void } + attr_writer :batch_size # Scaling factor for the learning rate. A smaller learning rate may be useful to # avoid overfitting. sig { returns(T.nilable(T.any(Symbol, Float))) } - def learning_rate_multiplier - end + attr_reader :learning_rate_multiplier - sig { params(_: T.any(Symbol, Float)).returns(T.any(Symbol, Float)) } - def learning_rate_multiplier=(_) - end + sig { params(learning_rate_multiplier: T.any(Symbol, Float)).void } + attr_writer :learning_rate_multiplier # The number of epochs to train the model for. An epoch refers to one full cycle # through the training dataset. sig { returns(T.nilable(T.any(Symbol, Integer))) } - def n_epochs - end + attr_reader :n_epochs - sig { params(_: T.any(Symbol, Integer)).returns(T.any(Symbol, Integer)) } - def n_epochs=(_) - end + sig { params(n_epochs: T.any(Symbol, Integer)).void } + attr_writer :n_epochs # The hyperparameters used for the fine-tuning job. sig do diff --git a/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi b/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi index 253cd1c0..52f286e3 100644 --- a/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/job_list_events_params.rbi @@ -9,21 +9,17 @@ module OpenAI # Identifier for the last event from the previous pagination request. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # Number of events to retrieve. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit sig do params( diff --git a/rbi/lib/openai/models/fine_tuning/job_list_params.rbi b/rbi/lib/openai/models/fine_tuning/job_list_params.rbi index 4102ced5..52610539 100644 --- a/rbi/lib/openai/models/fine_tuning/job_list_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/job_list_params.rbi @@ -9,31 +9,22 @@ module OpenAI # Identifier for the last job from the previous pagination request. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # Number of fine-tuning jobs to retrieve. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Optional metadata filter. To filter, use the syntax `metadata[k]=v`. # Alternatively, set `metadata=null` to indicate no metadata. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata sig do params( diff --git a/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi b/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi index 36ce4669..793f2f71 100644 --- a/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi +++ b/rbi/lib/openai/models/fine_tuning/jobs/checkpoint_list_params.rbi @@ -10,21 +10,17 @@ module OpenAI # Identifier for the last checkpoint ID from the previous pagination request. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # Number of checkpoints to retrieve. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit sig do params( diff --git a/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi b/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi index faed91db..de47d120 100644 --- a/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi +++ b/rbi/lib/openai/models/fine_tuning/jobs/fine_tuning_job_checkpoint.rbi @@ -7,71 +7,39 @@ module OpenAI class FineTuningJobCheckpoint < OpenAI::BaseModel # The checkpoint identifier, which can be referenced in the API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the checkpoint was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The name of the fine-tuned checkpoint model that is created. sig { returns(String) } - def fine_tuned_model_checkpoint - end - - sig { params(_: String).returns(String) } - def fine_tuned_model_checkpoint=(_) - end + attr_accessor :fine_tuned_model_checkpoint # The name of the fine-tuning job that this checkpoint was created from. sig { returns(String) } - def fine_tuning_job_id - end - - sig { params(_: String).returns(String) } - def fine_tuning_job_id=(_) - end + attr_accessor :fine_tuning_job_id # Metrics at the step number during the fine-tuning job. sig { returns(OpenAI::Models::FineTuning::Jobs::FineTuningJobCheckpoint::Metrics) } - def metrics - end + attr_reader :metrics sig do params( - _: T.any(OpenAI::Models::FineTuning::Jobs::FineTuningJobCheckpoint::Metrics, OpenAI::Util::AnyHash) + metrics: T.any(OpenAI::Models::FineTuning::Jobs::FineTuningJobCheckpoint::Metrics, OpenAI::Util::AnyHash) ) - .returns(T.any(OpenAI::Models::FineTuning::Jobs::FineTuningJobCheckpoint::Metrics, OpenAI::Util::AnyHash)) - end - def metrics=(_) + .void end + attr_writer :metrics # The object type, which is always "fine_tuning.job.checkpoint". sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The step number that the checkpoint was created at. sig { returns(Integer) } - def step_number - end - - sig { params(_: Integer).returns(Integer) } - def step_number=(_) - end + attr_accessor :step_number # The `fine_tuning.job.checkpoint` object represents a model checkpoint for a # fine-tuning job that is ready to use. @@ -117,60 +85,46 @@ module OpenAI class Metrics < OpenAI::BaseModel sig { returns(T.nilable(Float)) } - def full_valid_loss - end + attr_reader :full_valid_loss - sig { params(_: Float).returns(Float) } - def full_valid_loss=(_) - end + sig { params(full_valid_loss: Float).void } + attr_writer :full_valid_loss sig { returns(T.nilable(Float)) } - def full_valid_mean_token_accuracy - end + attr_reader :full_valid_mean_token_accuracy - sig { params(_: Float).returns(Float) } - def full_valid_mean_token_accuracy=(_) - end + sig { params(full_valid_mean_token_accuracy: Float).void } + attr_writer :full_valid_mean_token_accuracy sig { returns(T.nilable(Float)) } - def step - end + attr_reader :step - sig { params(_: Float).returns(Float) } - def step=(_) - end + sig { params(step: Float).void } + attr_writer :step sig { returns(T.nilable(Float)) } - def train_loss - end + attr_reader :train_loss - sig { params(_: Float).returns(Float) } - def train_loss=(_) - end + sig { params(train_loss: Float).void } + attr_writer :train_loss sig { returns(T.nilable(Float)) } - def train_mean_token_accuracy - end + attr_reader :train_mean_token_accuracy - sig { params(_: Float).returns(Float) } - def train_mean_token_accuracy=(_) - end + sig { params(train_mean_token_accuracy: Float).void } + attr_writer :train_mean_token_accuracy sig { returns(T.nilable(Float)) } - def valid_loss - end + attr_reader :valid_loss - sig { params(_: Float).returns(Float) } - def valid_loss=(_) - end + sig { params(valid_loss: Float).void } + attr_writer :valid_loss sig { returns(T.nilable(Float)) } - def valid_mean_token_accuracy - end + attr_reader :valid_mean_token_accuracy - sig { params(_: Float).returns(Float) } - def valid_mean_token_accuracy=(_) - end + sig { params(valid_mean_token_accuracy: Float).void } + attr_writer :valid_mean_token_accuracy # Metrics at the step number during the fine-tuning job. sig do diff --git a/rbi/lib/openai/models/function_definition.rbi b/rbi/lib/openai/models/function_definition.rbi index 542b14aa..f1bad3a8 100644 --- a/rbi/lib/openai/models/function_definition.rbi +++ b/rbi/lib/openai/models/function_definition.rbi @@ -6,22 +6,15 @@ module OpenAI # The name of the function to be called. Must be a-z, A-Z, 0-9, or contain # underscores and dashes, with a maximum length of 64. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # A description of what the function does, used by the model to choose when and # how to call the function. sig { returns(T.nilable(String)) } - def description - end + attr_reader :description - sig { params(_: String).returns(String) } - def description=(_) - end + sig { params(description: String).void } + attr_writer :description # The parameters the functions accepts, described as a JSON Schema object. See the # [guide](https://platform.openai.com/docs/guides/function-calling) for examples, @@ -31,12 +24,10 @@ module OpenAI # # Omitting `parameters` defines a function with an empty parameter list. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - def parameters - end + attr_reader :parameters - sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } - def parameters=(_) - end + sig { params(parameters: T::Hash[Symbol, T.anything]).void } + attr_writer :parameters # Whether to enable strict schema adherence when generating the function call. If # set to true, the model will follow the exact schema defined in the `parameters` @@ -44,12 +35,7 @@ module OpenAI # more about Structured Outputs in the # [function calling guide](docs/guides/function-calling). sig { returns(T.nilable(T::Boolean)) } - def strict - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def strict=(_) - end + attr_accessor :strict sig do params( diff --git a/rbi/lib/openai/models/image.rbi b/rbi/lib/openai/models/image.rbi index 3c0fc4fa..5af93081 100644 --- a/rbi/lib/openai/models/image.rbi +++ b/rbi/lib/openai/models/image.rbi @@ -6,31 +6,25 @@ module OpenAI # The base64-encoded JSON of the generated image, if `response_format` is # `b64_json`. sig { returns(T.nilable(String)) } - def b64_json - end + attr_reader :b64_json - sig { params(_: String).returns(String) } - def b64_json=(_) - end + sig { params(b64_json: String).void } + attr_writer :b64_json # The prompt that was used to generate the image, if there was any revision to the # prompt. sig { returns(T.nilable(String)) } - def revised_prompt - end + attr_reader :revised_prompt - sig { params(_: String).returns(String) } - def revised_prompt=(_) - end + sig { params(revised_prompt: String).void } + attr_writer :revised_prompt # The URL of the generated image, if `response_format` is `url` (default). sig { returns(T.nilable(String)) } - def url - end + attr_reader :url - sig { params(_: String).returns(String) } - def url=(_) - end + sig { params(url: String).void } + attr_writer :url # Represents the url or the content of an image generated by the OpenAI API. sig { params(b64_json: String, revised_prompt: String, url: String).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/image_create_variation_params.rbi b/rbi/lib/openai/models/image_create_variation_params.rbi index 2a711dc2..5e353218 100644 --- a/rbi/lib/openai/models/image_create_variation_params.rbi +++ b/rbi/lib/openai/models/image_create_variation_params.rbi @@ -9,73 +9,37 @@ module OpenAI # The image to use as the basis for the variation(s). Must be a valid PNG file, # less than 4MB, and square. sig { returns(T.any(IO, StringIO)) } - def image - end - - sig { params(_: T.any(IO, StringIO)).returns(T.any(IO, StringIO)) } - def image=(_) - end + attr_accessor :image # The model to use for image generation. Only `dall-e-2` is supported at this # time. sig { returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) } - def model - end - - sig do - params(_: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) - .returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) - end - def model=(_) - end + attr_accessor :model # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only # `n=1` is supported. sig { returns(T.nilable(Integer)) } - def n - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def n=(_) - end + attr_accessor :n # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been # generated. sig { returns(T.nilable(OpenAI::Models::ImageCreateVariationParams::ResponseFormat::OrSymbol)) } - def response_format - end - - sig do - params(_: T.nilable(OpenAI::Models::ImageCreateVariationParams::ResponseFormat::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ImageCreateVariationParams::ResponseFormat::OrSymbol)) - end - def response_format=(_) - end + attr_accessor :response_format # The size of the generated images. Must be one of `256x256`, `512x512`, or # `1024x1024`. sig { returns(T.nilable(OpenAI::Models::ImageCreateVariationParams::Size::OrSymbol)) } - def size - end - - sig do - params(_: T.nilable(OpenAI::Models::ImageCreateVariationParams::Size::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ImageCreateVariationParams::Size::OrSymbol)) - end - def size=(_) - end + attr_accessor :size # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). sig { returns(T.nilable(String)) } - def user - end + attr_reader :user - sig { params(_: String).returns(String) } - def user=(_) - end + sig { params(user: String).void } + attr_writer :user sig do params( diff --git a/rbi/lib/openai/models/image_edit_params.rbi b/rbi/lib/openai/models/image_edit_params.rbi index 3fad72eb..5752e130 100644 --- a/rbi/lib/openai/models/image_edit_params.rbi +++ b/rbi/lib/openai/models/image_edit_params.rbi @@ -9,93 +9,50 @@ module OpenAI # The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask # is not provided, image must have transparency, which will be used as the mask. sig { returns(T.any(IO, StringIO)) } - def image - end - - sig { params(_: T.any(IO, StringIO)).returns(T.any(IO, StringIO)) } - def image=(_) - end + attr_accessor :image # A text description of the desired image(s). The maximum length is 1000 # characters. sig { returns(String) } - def prompt - end - - sig { params(_: String).returns(String) } - def prompt=(_) - end + attr_accessor :prompt # An additional image whose fully transparent areas (e.g. where alpha is zero) # indicate where `image` should be edited. Must be a valid PNG file, less than # 4MB, and have the same dimensions as `image`. sig { returns(T.nilable(T.any(IO, StringIO))) } - def mask - end + attr_reader :mask - sig { params(_: T.any(IO, StringIO)).returns(T.any(IO, StringIO)) } - def mask=(_) - end + sig { params(mask: T.any(IO, StringIO)).void } + attr_writer :mask # The model to use for image generation. Only `dall-e-2` is supported at this # time. sig { returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) } - def model - end - - sig do - params(_: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) - .returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) - end - def model=(_) - end + attr_accessor :model # The number of images to generate. Must be between 1 and 10. sig { returns(T.nilable(Integer)) } - def n - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def n=(_) - end + attr_accessor :n # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been # generated. sig { returns(T.nilable(OpenAI::Models::ImageEditParams::ResponseFormat::OrSymbol)) } - def response_format - end - - sig do - params(_: T.nilable(OpenAI::Models::ImageEditParams::ResponseFormat::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ImageEditParams::ResponseFormat::OrSymbol)) - end - def response_format=(_) - end + attr_accessor :response_format # The size of the generated images. Must be one of `256x256`, `512x512`, or # `1024x1024`. sig { returns(T.nilable(OpenAI::Models::ImageEditParams::Size::OrSymbol)) } - def size - end - - sig do - params(_: T.nilable(OpenAI::Models::ImageEditParams::Size::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ImageEditParams::Size::OrSymbol)) - end - def size=(_) - end + attr_accessor :size # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). sig { returns(T.nilable(String)) } - def user - end + attr_reader :user - sig { params(_: String).returns(String) } - def user=(_) - end + sig { params(user: String).void } + attr_writer :user sig do params( diff --git a/rbi/lib/openai/models/image_generate_params.rbi b/rbi/lib/openai/models/image_generate_params.rbi index 513ce790..97f922c3 100644 --- a/rbi/lib/openai/models/image_generate_params.rbi +++ b/rbi/lib/openai/models/image_generate_params.rbi @@ -9,102 +9,53 @@ module OpenAI # A text description of the desired image(s). The maximum length is 1000 # characters for `dall-e-2` and 4000 characters for `dall-e-3`. sig { returns(String) } - def prompt - end - - sig { params(_: String).returns(String) } - def prompt=(_) - end + attr_accessor :prompt # The model to use for image generation. sig { returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) } - def model - end - - sig do - params(_: T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) - .returns(T.nilable(T.any(String, OpenAI::Models::ImageModel::OrSymbol))) - end - def model=(_) - end + attr_accessor :model # The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only # `n=1` is supported. sig { returns(T.nilable(Integer)) } - def n - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def n=(_) - end + attr_accessor :n # The quality of the image that will be generated. `hd` creates images with finer # details and greater consistency across the image. This param is only supported # for `dall-e-3`. sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Quality::OrSymbol)) } - def quality - end + attr_reader :quality - sig do - params(_: OpenAI::Models::ImageGenerateParams::Quality::OrSymbol) - .returns(OpenAI::Models::ImageGenerateParams::Quality::OrSymbol) - end - def quality=(_) - end + sig { params(quality: OpenAI::Models::ImageGenerateParams::Quality::OrSymbol).void } + attr_writer :quality # The format in which the generated images are returned. Must be one of `url` or # `b64_json`. URLs are only valid for 60 minutes after the image has been # generated. sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::ResponseFormat::OrSymbol)) } - def response_format - end - - sig do - params(_: T.nilable(OpenAI::Models::ImageGenerateParams::ResponseFormat::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ImageGenerateParams::ResponseFormat::OrSymbol)) - end - def response_format=(_) - end + attr_accessor :response_format # The size of the generated images. Must be one of `256x256`, `512x512`, or # `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or # `1024x1792` for `dall-e-3` models. sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Size::OrSymbol)) } - def size - end - - sig do - params(_: T.nilable(OpenAI::Models::ImageGenerateParams::Size::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ImageGenerateParams::Size::OrSymbol)) - end - def size=(_) - end + attr_accessor :size # The style of the generated images. Must be one of `vivid` or `natural`. Vivid # causes the model to lean towards generating hyper-real and dramatic images. # Natural causes the model to produce more natural, less hyper-real looking # images. This param is only supported for `dall-e-3`. sig { returns(T.nilable(OpenAI::Models::ImageGenerateParams::Style::OrSymbol)) } - def style - end - - sig do - params(_: T.nilable(OpenAI::Models::ImageGenerateParams::Style::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ImageGenerateParams::Style::OrSymbol)) - end - def style=(_) - end + attr_accessor :style # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). sig { returns(T.nilable(String)) } - def user - end + attr_reader :user - sig { params(_: String).returns(String) } - def user=(_) - end + sig { params(user: String).void } + attr_writer :user sig do params( diff --git a/rbi/lib/openai/models/images_response.rbi b/rbi/lib/openai/models/images_response.rbi index 724883f8..5395968e 100644 --- a/rbi/lib/openai/models/images_response.rbi +++ b/rbi/lib/openai/models/images_response.rbi @@ -4,20 +4,10 @@ module OpenAI module Models class ImagesResponse < OpenAI::BaseModel sig { returns(Integer) } - def created - end - - sig { params(_: Integer).returns(Integer) } - def created=(_) - end + attr_accessor :created sig { returns(T::Array[OpenAI::Models::Image]) } - def data - end - - sig { params(_: T::Array[OpenAI::Models::Image]).returns(T::Array[OpenAI::Models::Image]) } - def data=(_) - end + attr_accessor :data sig do params(created: Integer, data: T::Array[T.any(OpenAI::Models::Image, OpenAI::Util::AnyHash)]) diff --git a/rbi/lib/openai/models/model.rbi b/rbi/lib/openai/models/model.rbi index 07b59908..556bb5fc 100644 --- a/rbi/lib/openai/models/model.rbi +++ b/rbi/lib/openai/models/model.rbi @@ -5,39 +5,19 @@ module OpenAI class Model < OpenAI::BaseModel # The model identifier, which can be referenced in the API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) when the model was created. sig { returns(Integer) } - def created - end - - sig { params(_: Integer).returns(Integer) } - def created=(_) - end + attr_accessor :created # The object type, which is always "model". sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The organization that owns the model. sig { returns(String) } - def owned_by - end - - sig { params(_: String).returns(String) } - def owned_by=(_) - end + attr_accessor :owned_by # Describes an OpenAI model offering that can be used with the API. sig { params(id: String, created: Integer, owned_by: String, object: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/model_deleted.rbi b/rbi/lib/openai/models/model_deleted.rbi index 6ed7605b..9888bb84 100644 --- a/rbi/lib/openai/models/model_deleted.rbi +++ b/rbi/lib/openai/models/model_deleted.rbi @@ -4,28 +4,13 @@ module OpenAI module Models class ModelDeleted < OpenAI::BaseModel sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id sig { returns(T::Boolean) } - def deleted - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def deleted=(_) - end + attr_accessor :deleted sig { returns(String) } - def object - end - - sig { params(_: String).returns(String) } - def object=(_) - end + attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: String).returns(T.attached_class) } def self.new(id:, deleted:, object:) diff --git a/rbi/lib/openai/models/moderation.rbi b/rbi/lib/openai/models/moderation.rbi index 26fc4f28..72848671 100644 --- a/rbi/lib/openai/models/moderation.rbi +++ b/rbi/lib/openai/models/moderation.rbi @@ -5,48 +5,33 @@ module OpenAI class Moderation < OpenAI::BaseModel # A list of the categories, and whether they are flagged or not. sig { returns(OpenAI::Models::Moderation::Categories) } - def categories - end + attr_reader :categories - sig do - params(_: T.any(OpenAI::Models::Moderation::Categories, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Moderation::Categories, OpenAI::Util::AnyHash)) - end - def categories=(_) - end + sig { params(categories: T.any(OpenAI::Models::Moderation::Categories, OpenAI::Util::AnyHash)).void } + attr_writer :categories # A list of the categories along with the input type(s) that the score applies to. sig { returns(OpenAI::Models::Moderation::CategoryAppliedInputTypes) } - def category_applied_input_types - end + attr_reader :category_applied_input_types sig do - params(_: T.any(OpenAI::Models::Moderation::CategoryAppliedInputTypes, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Moderation::CategoryAppliedInputTypes, OpenAI::Util::AnyHash)) - end - def category_applied_input_types=(_) + params( + category_applied_input_types: T.any(OpenAI::Models::Moderation::CategoryAppliedInputTypes, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :category_applied_input_types # A list of the categories along with their scores as predicted by model. sig { returns(OpenAI::Models::Moderation::CategoryScores) } - def category_scores - end + attr_reader :category_scores - sig do - params(_: T.any(OpenAI::Models::Moderation::CategoryScores, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Moderation::CategoryScores, OpenAI::Util::AnyHash)) - end - def category_scores=(_) - end + sig { params(category_scores: T.any(OpenAI::Models::Moderation::CategoryScores, OpenAI::Util::AnyHash)).void } + attr_writer :category_scores # Whether any of the below categories are flagged. sig { returns(T::Boolean) } - def flagged - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def flagged=(_) - end + attr_accessor :flagged sig do params( @@ -78,136 +63,71 @@ module OpenAI # Content that expresses, incites, or promotes harassing language towards any # target. sig { returns(T::Boolean) } - def harassment - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def harassment=(_) - end + attr_accessor :harassment # Harassment content that also includes violence or serious harm towards any # target. sig { returns(T::Boolean) } - def harassment_threatening - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def harassment_threatening=(_) - end + attr_accessor :harassment_threatening # Content that expresses, incites, or promotes hate based on race, gender, # ethnicity, religion, nationality, sexual orientation, disability status, or # caste. Hateful content aimed at non-protected groups (e.g., chess players) is # harassment. sig { returns(T::Boolean) } - def hate - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def hate=(_) - end + attr_accessor :hate # Hateful content that also includes violence or serious harm towards the targeted # group based on race, gender, ethnicity, religion, nationality, sexual # orientation, disability status, or caste. sig { returns(T::Boolean) } - def hate_threatening - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def hate_threatening=(_) - end + attr_accessor :hate_threatening # Content that includes instructions or advice that facilitate the planning or # execution of wrongdoing, or that gives advice or instruction on how to commit # illicit acts. For example, "how to shoplift" would fit this category. sig { returns(T.nilable(T::Boolean)) } - def illicit - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def illicit=(_) - end + attr_accessor :illicit # Content that includes instructions or advice that facilitate the planning or # execution of wrongdoing that also includes violence, or that gives advice or # instruction on the procurement of any weapon. sig { returns(T.nilable(T::Boolean)) } - def illicit_violent - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def illicit_violent=(_) - end + attr_accessor :illicit_violent # Content that promotes, encourages, or depicts acts of self-harm, such as # suicide, cutting, and eating disorders. sig { returns(T::Boolean) } - def self_harm - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def self_harm=(_) - end + attr_accessor :self_harm # Content that encourages performing acts of self-harm, such as suicide, cutting, # and eating disorders, or that gives instructions or advice on how to commit such # acts. sig { returns(T::Boolean) } - def self_harm_instructions - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def self_harm_instructions=(_) - end + attr_accessor :self_harm_instructions # Content where the speaker expresses that they are engaging or intend to engage # in acts of self-harm, such as suicide, cutting, and eating disorders. sig { returns(T::Boolean) } - def self_harm_intent - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def self_harm_intent=(_) - end + attr_accessor :self_harm_intent # Content meant to arouse sexual excitement, such as the description of sexual # activity, or that promotes sexual services (excluding sex education and # wellness). sig { returns(T::Boolean) } - def sexual - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def sexual=(_) - end + attr_accessor :sexual # Sexual content that includes an individual who is under 18 years old. sig { returns(T::Boolean) } - def sexual_minors - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def sexual_minors=(_) - end + attr_accessor :sexual_minors # Content that depicts death, violence, or physical injury. sig { returns(T::Boolean) } - def violence - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def violence=(_) - end + attr_accessor :violence # Content that depicts death, violence, or physical injury in graphic detail. sig { returns(T::Boolean) } - def violence_graphic - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def violence_graphic=(_) - end + attr_accessor :violence_graphic # A list of the categories, and whether they are flagged or not. sig do @@ -272,15 +192,7 @@ module OpenAI class CategoryAppliedInputTypes < OpenAI::BaseModel # The applied input type(s) for the category 'harassment'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Harassment::TaggedSymbol]) } - def harassment - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Harassment::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Harassment::TaggedSymbol]) - end - def harassment=(_) - end + attr_accessor :harassment # The applied input type(s) for the category 'harassment/threatening'. sig do @@ -288,79 +200,27 @@ module OpenAI T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::HarassmentThreatening::TaggedSymbol] ) end - def harassment_threatening - end - - sig do - params( - _: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::HarassmentThreatening::TaggedSymbol] - ) - .returns( - T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::HarassmentThreatening::TaggedSymbol] - ) - end - def harassment_threatening=(_) - end + attr_accessor :harassment_threatening # The applied input type(s) for the category 'hate'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Hate::TaggedSymbol]) } - def hate - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Hate::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Hate::TaggedSymbol]) - end - def hate=(_) - end + attr_accessor :hate # The applied input type(s) for the category 'hate/threatening'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::HateThreatening::TaggedSymbol]) } - def hate_threatening - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::HateThreatening::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::HateThreatening::TaggedSymbol]) - end - def hate_threatening=(_) - end + attr_accessor :hate_threatening # The applied input type(s) for the category 'illicit'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Illicit::TaggedSymbol]) } - def illicit - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Illicit::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Illicit::TaggedSymbol]) - end - def illicit=(_) - end + attr_accessor :illicit # The applied input type(s) for the category 'illicit/violent'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::IllicitViolent::TaggedSymbol]) } - def illicit_violent - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::IllicitViolent::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::IllicitViolent::TaggedSymbol]) - end - def illicit_violent=(_) - end + attr_accessor :illicit_violent # The applied input type(s) for the category 'self-harm'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarm::TaggedSymbol]) } - def self_harm - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarm::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarm::TaggedSymbol]) - end - def self_harm=(_) - end + attr_accessor :self_harm # The applied input type(s) for the category 'self-harm/instructions'. sig do @@ -368,79 +228,27 @@ module OpenAI T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarmInstruction::TaggedSymbol] ) end - def self_harm_instructions - end - - sig do - params( - _: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarmInstruction::TaggedSymbol] - ) - .returns( - T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarmInstruction::TaggedSymbol] - ) - end - def self_harm_instructions=(_) - end + attr_accessor :self_harm_instructions # The applied input type(s) for the category 'self-harm/intent'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarmIntent::TaggedSymbol]) } - def self_harm_intent - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarmIntent::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SelfHarmIntent::TaggedSymbol]) - end - def self_harm_intent=(_) - end + attr_accessor :self_harm_intent # The applied input type(s) for the category 'sexual'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Sexual::TaggedSymbol]) } - def sexual - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Sexual::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Sexual::TaggedSymbol]) - end - def sexual=(_) - end + attr_accessor :sexual # The applied input type(s) for the category 'sexual/minors'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SexualMinor::TaggedSymbol]) } - def sexual_minors - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SexualMinor::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::SexualMinor::TaggedSymbol]) - end - def sexual_minors=(_) - end + attr_accessor :sexual_minors # The applied input type(s) for the category 'violence'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Violence::TaggedSymbol]) } - def violence - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Violence::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::Violence::TaggedSymbol]) - end - def violence=(_) - end + attr_accessor :violence # The applied input type(s) for the category 'violence/graphic'. sig { returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::ViolenceGraphic::TaggedSymbol]) } - def violence_graphic - end - - sig do - params(_: T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::ViolenceGraphic::TaggedSymbol]) - .returns(T::Array[OpenAI::Models::Moderation::CategoryAppliedInputTypes::ViolenceGraphic::TaggedSymbol]) - end - def violence_graphic=(_) - end + attr_accessor :violence_graphic # A list of the categories along with the input type(s) that the score applies to. sig do @@ -764,120 +572,55 @@ module OpenAI class CategoryScores < OpenAI::BaseModel # The score for the category 'harassment'. sig { returns(Float) } - def harassment - end - - sig { params(_: Float).returns(Float) } - def harassment=(_) - end + attr_accessor :harassment # The score for the category 'harassment/threatening'. sig { returns(Float) } - def harassment_threatening - end - - sig { params(_: Float).returns(Float) } - def harassment_threatening=(_) - end + attr_accessor :harassment_threatening # The score for the category 'hate'. sig { returns(Float) } - def hate - end - - sig { params(_: Float).returns(Float) } - def hate=(_) - end + attr_accessor :hate # The score for the category 'hate/threatening'. sig { returns(Float) } - def hate_threatening - end - - sig { params(_: Float).returns(Float) } - def hate_threatening=(_) - end + attr_accessor :hate_threatening # The score for the category 'illicit'. sig { returns(Float) } - def illicit - end - - sig { params(_: Float).returns(Float) } - def illicit=(_) - end + attr_accessor :illicit # The score for the category 'illicit/violent'. sig { returns(Float) } - def illicit_violent - end - - sig { params(_: Float).returns(Float) } - def illicit_violent=(_) - end + attr_accessor :illicit_violent # The score for the category 'self-harm'. sig { returns(Float) } - def self_harm - end - - sig { params(_: Float).returns(Float) } - def self_harm=(_) - end + attr_accessor :self_harm # The score for the category 'self-harm/instructions'. sig { returns(Float) } - def self_harm_instructions - end - - sig { params(_: Float).returns(Float) } - def self_harm_instructions=(_) - end + attr_accessor :self_harm_instructions # The score for the category 'self-harm/intent'. sig { returns(Float) } - def self_harm_intent - end - - sig { params(_: Float).returns(Float) } - def self_harm_intent=(_) - end + attr_accessor :self_harm_intent # The score for the category 'sexual'. sig { returns(Float) } - def sexual - end - - sig { params(_: Float).returns(Float) } - def sexual=(_) - end + attr_accessor :sexual # The score for the category 'sexual/minors'. sig { returns(Float) } - def sexual_minors - end - - sig { params(_: Float).returns(Float) } - def sexual_minors=(_) - end + attr_accessor :sexual_minors # The score for the category 'violence'. sig { returns(Float) } - def violence - end - - sig { params(_: Float).returns(Float) } - def violence=(_) - end + attr_accessor :violence # The score for the category 'violence/graphic'. sig { returns(Float) } - def violence_graphic - end - - sig { params(_: Float).returns(Float) } - def violence_graphic=(_) - end + attr_accessor :violence_graphic # A list of the categories along with their scores as predicted by model. sig do diff --git a/rbi/lib/openai/models/moderation_create_params.rbi b/rbi/lib/openai/models/moderation_create_params.rbi index 591f644a..5487b934 100644 --- a/rbi/lib/openai/models/moderation_create_params.rbi +++ b/rbi/lib/openai/models/moderation_create_params.rbi @@ -17,42 +17,17 @@ module OpenAI ) ) end - def input - end - - sig do - params( - _: T.any( - String, - T::Array[String], - T::Array[T.any(OpenAI::Models::ModerationImageURLInput, OpenAI::Models::ModerationTextInput)] - ) - ) - .returns( - T.any( - String, - T::Array[String], - T::Array[T.any(OpenAI::Models::ModerationImageURLInput, OpenAI::Models::ModerationTextInput)] - ) - ) - end - def input=(_) - end + attr_accessor :input # The content moderation model you would like to use. Learn more in # [the moderation guide](https://platform.openai.com/docs/guides/moderation), and # learn about available models # [here](https://platform.openai.com/docs/models#moderation). sig { returns(T.nilable(T.any(String, OpenAI::Models::ModerationModel::OrSymbol))) } - def model - end + attr_reader :model - sig do - params(_: T.any(String, OpenAI::Models::ModerationModel::OrSymbol)) - .returns(T.any(String, OpenAI::Models::ModerationModel::OrSymbol)) - end - def model=(_) - end + sig { params(model: T.any(String, OpenAI::Models::ModerationModel::OrSymbol)).void } + attr_writer :model sig do params( diff --git a/rbi/lib/openai/models/moderation_create_response.rbi b/rbi/lib/openai/models/moderation_create_response.rbi index c3a9c5d8..0de2d5b0 100644 --- a/rbi/lib/openai/models/moderation_create_response.rbi +++ b/rbi/lib/openai/models/moderation_create_response.rbi @@ -5,30 +5,15 @@ module OpenAI class ModerationCreateResponse < OpenAI::BaseModel # The unique identifier for the moderation request. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The model used to generate the moderation results. sig { returns(String) } - def model - end - - sig { params(_: String).returns(String) } - def model=(_) - end + attr_accessor :model # A list of moderation objects. sig { returns(T::Array[OpenAI::Models::Moderation]) } - def results - end - - sig { params(_: T::Array[OpenAI::Models::Moderation]).returns(T::Array[OpenAI::Models::Moderation]) } - def results=(_) - end + attr_accessor :results # Represents if a given text input is potentially harmful. sig do diff --git a/rbi/lib/openai/models/moderation_image_url_input.rbi b/rbi/lib/openai/models/moderation_image_url_input.rbi index 52ba6b82..5d3fb30a 100644 --- a/rbi/lib/openai/models/moderation_image_url_input.rbi +++ b/rbi/lib/openai/models/moderation_image_url_input.rbi @@ -5,24 +5,14 @@ module OpenAI class ModerationImageURLInput < OpenAI::BaseModel # Contains either an image URL or a data URL for a base64 encoded image. sig { returns(OpenAI::Models::ModerationImageURLInput::ImageURL) } - def image_url - end + attr_reader :image_url - sig do - params(_: T.any(OpenAI::Models::ModerationImageURLInput::ImageURL, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::ModerationImageURLInput::ImageURL, OpenAI::Util::AnyHash)) - end - def image_url=(_) - end + sig { params(image_url: T.any(OpenAI::Models::ModerationImageURLInput::ImageURL, OpenAI::Util::AnyHash)).void } + attr_writer :image_url # Always `image_url`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An object describing an image to classify. sig do @@ -42,12 +32,7 @@ module OpenAI class ImageURL < OpenAI::BaseModel # Either a URL of the image or the base64 encoded image data. sig { returns(String) } - def url - end - - sig { params(_: String).returns(String) } - def url=(_) - end + attr_accessor :url # Contains either an image URL or a data URL for a base64 encoded image. sig { params(url: String).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/moderation_text_input.rbi b/rbi/lib/openai/models/moderation_text_input.rbi index 41888533..dddf6d0b 100644 --- a/rbi/lib/openai/models/moderation_text_input.rbi +++ b/rbi/lib/openai/models/moderation_text_input.rbi @@ -5,21 +5,11 @@ module OpenAI class ModerationTextInput < OpenAI::BaseModel # A string of text to classify. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # Always `text`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An object describing text to classify. sig { params(text: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi b/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi index db3ddb71..14da388e 100644 --- a/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi +++ b/rbi/lib/openai/models/other_file_chunking_strategy_object.rbi @@ -5,12 +5,7 @@ module OpenAI class OtherFileChunkingStrategyObject < OpenAI::BaseModel # Always `other`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # This is returned when the chunking strategy is unknown. Typically, this is # because the file was indexed before the `chunking_strategy` concept was diff --git a/rbi/lib/openai/models/reasoning.rbi b/rbi/lib/openai/models/reasoning.rbi index f221616f..18587255 100644 --- a/rbi/lib/openai/models/reasoning.rbi +++ b/rbi/lib/openai/models/reasoning.rbi @@ -10,15 +10,7 @@ module OpenAI # supported values are `low`, `medium`, and `high`. Reducing reasoning effort can # result in faster responses and fewer tokens used on reasoning in a response. sig { returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) } - def effort - end - - sig do - params(_: T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - .returns(T.nilable(OpenAI::Models::ReasoningEffort::OrSymbol)) - end - def effort=(_) - end + attr_accessor :effort # **computer_use_preview only** # @@ -26,15 +18,7 @@ module OpenAI # debugging and understanding the model's reasoning process. One of `concise` or # `detailed`. sig { returns(T.nilable(OpenAI::Models::Reasoning::GenerateSummary::OrSymbol)) } - def generate_summary - end - - sig do - params(_: T.nilable(OpenAI::Models::Reasoning::GenerateSummary::OrSymbol)) - .returns(T.nilable(OpenAI::Models::Reasoning::GenerateSummary::OrSymbol)) - end - def generate_summary=(_) - end + attr_accessor :generate_summary # **o-series models only** # diff --git a/rbi/lib/openai/models/response_format_json_object.rbi b/rbi/lib/openai/models/response_format_json_object.rbi index 044c6ff6..331cb19e 100644 --- a/rbi/lib/openai/models/response_format_json_object.rbi +++ b/rbi/lib/openai/models/response_format_json_object.rbi @@ -5,12 +5,7 @@ module OpenAI class ResponseFormatJSONObject < OpenAI::BaseModel # The type of response format being defined. Always `json_object`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # JSON object response format. An older method of generating JSON responses. Using # `json_schema` is recommended for models that support it. Note that the model diff --git a/rbi/lib/openai/models/response_format_json_schema.rbi b/rbi/lib/openai/models/response_format_json_schema.rbi index 01da50a3..ea87d33f 100644 --- a/rbi/lib/openai/models/response_format_json_schema.rbi +++ b/rbi/lib/openai/models/response_format_json_schema.rbi @@ -5,24 +5,17 @@ module OpenAI class ResponseFormatJSONSchema < OpenAI::BaseModel # Structured Outputs configuration options, including a JSON Schema. sig { returns(OpenAI::Models::ResponseFormatJSONSchema::JSONSchema) } - def json_schema - end + attr_reader :json_schema sig do - params(_: T.any(OpenAI::Models::ResponseFormatJSONSchema::JSONSchema, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::ResponseFormatJSONSchema::JSONSchema, OpenAI::Util::AnyHash)) - end - def json_schema=(_) + params(json_schema: T.any(OpenAI::Models::ResponseFormatJSONSchema::JSONSchema, OpenAI::Util::AnyHash)) + .void end + attr_writer :json_schema # The type of response format being defined. Always `json_schema`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # JSON Schema response format. Used to generate structured JSON responses. Learn # more about @@ -45,32 +38,23 @@ module OpenAI # The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores # and dashes, with a maximum length of 64. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # A description of what the response format is for, used by the model to determine # how to respond in the format. sig { returns(T.nilable(String)) } - def description - end + attr_reader :description - sig { params(_: String).returns(String) } - def description=(_) - end + sig { params(description: String).void } + attr_writer :description # The schema for the response format, described as a JSON Schema object. Learn how # to build JSON schemas [here](https://json-schema.org/). sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - def schema - end + attr_reader :schema - sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } - def schema=(_) - end + sig { params(schema: T::Hash[Symbol, T.anything]).void } + attr_writer :schema # Whether to enable strict schema adherence when generating the output. If set to # true, the model will always follow the exact schema defined in the `schema` @@ -78,12 +62,7 @@ module OpenAI # learn more, read the # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). sig { returns(T.nilable(T::Boolean)) } - def strict - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def strict=(_) - end + attr_accessor :strict # Structured Outputs configuration options, including a JSON Schema. sig do diff --git a/rbi/lib/openai/models/response_format_text.rbi b/rbi/lib/openai/models/response_format_text.rbi index 2894efdf..a4b2db5e 100644 --- a/rbi/lib/openai/models/response_format_text.rbi +++ b/rbi/lib/openai/models/response_format_text.rbi @@ -5,12 +5,7 @@ module OpenAI class ResponseFormatText < OpenAI::BaseModel # The type of response format being defined. Always `text`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Default response format. Used to generate text responses. sig { params(type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/computer_tool.rbi b/rbi/lib/openai/models/responses/computer_tool.rbi index 82add0e9..84a8caab 100644 --- a/rbi/lib/openai/models/responses/computer_tool.rbi +++ b/rbi/lib/openai/models/responses/computer_tool.rbi @@ -6,42 +6,19 @@ module OpenAI class ComputerTool < OpenAI::BaseModel # The height of the computer display. sig { returns(Float) } - def display_height - end - - sig { params(_: Float).returns(Float) } - def display_height=(_) - end + attr_accessor :display_height # The width of the computer display. sig { returns(Float) } - def display_width - end - - sig { params(_: Float).returns(Float) } - def display_width=(_) - end + attr_accessor :display_width # The type of computer environment to control. sig { returns(OpenAI::Models::Responses::ComputerTool::Environment::OrSymbol) } - def environment - end - - sig do - params(_: OpenAI::Models::Responses::ComputerTool::Environment::OrSymbol) - .returns(OpenAI::Models::Responses::ComputerTool::Environment::OrSymbol) - end - def environment=(_) - end + attr_accessor :environment # The type of the computer use tool. Always `computer_use_preview`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A tool that controls a virtual computer. Learn more about the # [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). diff --git a/rbi/lib/openai/models/responses/easy_input_message.rbi b/rbi/lib/openai/models/responses/easy_input_message.rbi index 18a3e4ee..926e6805 100644 --- a/rbi/lib/openai/models/responses/easy_input_message.rbi +++ b/rbi/lib/openai/models/responses/easy_input_message.rbi @@ -20,62 +20,19 @@ module OpenAI ) ) end - def content - end - - sig do - params( - _: T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputText, - OpenAI::Models::Responses::ResponseInputImage, - OpenAI::Models::Responses::ResponseInputFile - ) - ] - ) - ) - .returns( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputText, - OpenAI::Models::Responses::ResponseInputImage, - OpenAI::Models::Responses::ResponseInputFile - ) - ] - ) - ) - end - def content=(_) - end + attr_accessor :content # The role of the message input. One of `user`, `assistant`, `system`, or # `developer`. sig { returns(OpenAI::Models::Responses::EasyInputMessage::Role::OrSymbol) } - def role - end - - sig do - params(_: OpenAI::Models::Responses::EasyInputMessage::Role::OrSymbol) - .returns(OpenAI::Models::Responses::EasyInputMessage::Role::OrSymbol) - end - def role=(_) - end + attr_accessor :role # The type of the message input. Always `message`. sig { returns(T.nilable(OpenAI::Models::Responses::EasyInputMessage::Type::OrSymbol)) } - def type - end + attr_reader :type - sig do - params(_: OpenAI::Models::Responses::EasyInputMessage::Type::OrSymbol) - .returns(OpenAI::Models::Responses::EasyInputMessage::Type::OrSymbol) - end - def type=(_) - end + sig { params(type: OpenAI::Models::Responses::EasyInputMessage::Type::OrSymbol).void } + attr_writer :type # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take diff --git a/rbi/lib/openai/models/responses/file_search_tool.rbi b/rbi/lib/openai/models/responses/file_search_tool.rbi index 4380f086..716402c5 100644 --- a/rbi/lib/openai/models/responses/file_search_tool.rbi +++ b/rbi/lib/openai/models/responses/file_search_tool.rbi @@ -6,55 +6,43 @@ module OpenAI class FileSearchTool < OpenAI::BaseModel # The type of the file search tool. Always `file_search`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The IDs of the vector stores to search. sig { returns(T::Array[String]) } - def vector_store_ids - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def vector_store_ids=(_) - end + attr_accessor :vector_store_ids # A filter to apply based on file attributes. sig { returns(T.nilable(T.any(OpenAI::Models::ComparisonFilter, OpenAI::Models::CompoundFilter))) } - def filters - end + attr_reader :filters sig do - params(_: T.any(OpenAI::Models::ComparisonFilter, OpenAI::Util::AnyHash, OpenAI::Models::CompoundFilter)) - .returns(T.any(OpenAI::Models::ComparisonFilter, OpenAI::Util::AnyHash, OpenAI::Models::CompoundFilter)) - end - def filters=(_) + params( + filters: T.any(OpenAI::Models::ComparisonFilter, OpenAI::Util::AnyHash, OpenAI::Models::CompoundFilter) + ) + .void end + attr_writer :filters # The maximum number of results to return. This number should be between 1 and 50 # inclusive. sig { returns(T.nilable(Integer)) } - def max_num_results - end + attr_reader :max_num_results - sig { params(_: Integer).returns(Integer) } - def max_num_results=(_) - end + sig { params(max_num_results: Integer).void } + attr_writer :max_num_results # Ranking options for search. sig { returns(T.nilable(OpenAI::Models::Responses::FileSearchTool::RankingOptions)) } - def ranking_options - end + attr_reader :ranking_options sig do - params(_: T.any(OpenAI::Models::Responses::FileSearchTool::RankingOptions, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::FileSearchTool::RankingOptions, OpenAI::Util::AnyHash)) - end - def ranking_options=(_) + params( + ranking_options: T.any(OpenAI::Models::Responses::FileSearchTool::RankingOptions, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :ranking_options # A tool that searches for relevant content from uploaded files. Learn more about # the @@ -104,26 +92,19 @@ module OpenAI class RankingOptions < OpenAI::BaseModel # The ranker to use for the file search. sig { returns(T.nilable(OpenAI::Models::Responses::FileSearchTool::RankingOptions::Ranker::OrSymbol)) } - def ranker - end + attr_reader :ranker - sig do - params(_: OpenAI::Models::Responses::FileSearchTool::RankingOptions::Ranker::OrSymbol) - .returns(OpenAI::Models::Responses::FileSearchTool::RankingOptions::Ranker::OrSymbol) - end - def ranker=(_) - end + sig { params(ranker: OpenAI::Models::Responses::FileSearchTool::RankingOptions::Ranker::OrSymbol).void } + attr_writer :ranker # The score threshold for the file search, a number between 0 and 1. Numbers # closer to 1 will attempt to return only the most relevant results, but may # return fewer results. sig { returns(T.nilable(Float)) } - def score_threshold - end + attr_reader :score_threshold - sig { params(_: Float).returns(Float) } - def score_threshold=(_) - end + sig { params(score_threshold: Float).void } + attr_writer :score_threshold # Ranking options for search. sig do diff --git a/rbi/lib/openai/models/responses/function_tool.rbi b/rbi/lib/openai/models/responses/function_tool.rbi index 8513be94..7462dada 100644 --- a/rbi/lib/openai/models/responses/function_tool.rbi +++ b/rbi/lib/openai/models/responses/function_tool.rbi @@ -6,49 +6,24 @@ module OpenAI class FunctionTool < OpenAI::BaseModel # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # A JSON schema object describing the parameters of the function. sig { returns(T::Hash[Symbol, T.anything]) } - def parameters - end - - sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } - def parameters=(_) - end + attr_accessor :parameters # Whether to enforce strict parameter validation. Default `true`. sig { returns(T::Boolean) } - def strict - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def strict=(_) - end + attr_accessor :strict # The type of the function tool. Always `function`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A description of the function. Used by the model to determine whether or not to # call the function. sig { returns(T.nilable(String)) } - def description - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def description=(_) - end + attr_accessor :description # Defines a function in your own code the model can choose to call. Learn more # about diff --git a/rbi/lib/openai/models/responses/input_item_list_params.rbi b/rbi/lib/openai/models/responses/input_item_list_params.rbi index b43cde65..0f383412 100644 --- a/rbi/lib/openai/models/responses/input_item_list_params.rbi +++ b/rbi/lib/openai/models/responses/input_item_list_params.rbi @@ -9,46 +9,35 @@ module OpenAI # An item ID to list items after, used in pagination. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # An item ID to list items before, used in pagination. sig { returns(T.nilable(String)) } - def before - end + attr_reader :before - sig { params(_: String).returns(String) } - def before=(_) - end + sig { params(before: String).void } + attr_writer :before # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # The order to return the input items in. Default is `asc`. # # - `asc`: Return the input items in ascending order. # - `desc`: Return the input items in descending order. sig { returns(T.nilable(OpenAI::Models::Responses::InputItemListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::Responses::InputItemListParams::Order::OrSymbol) - .returns(OpenAI::Models::Responses::InputItemListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::Responses::InputItemListParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/responses/response.rbi b/rbi/lib/openai/models/responses/response.rbi index 6aabb7ec..366aa274 100644 --- a/rbi/lib/openai/models/responses/response.rbi +++ b/rbi/lib/openai/models/responses/response.rbi @@ -6,45 +6,30 @@ module OpenAI class Response < OpenAI::BaseModel # Unique identifier for this Response. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # Unix timestamp (in seconds) of when this Response was created. sig { returns(Float) } - def created_at - end - - sig { params(_: Float).returns(Float) } - def created_at=(_) - end + attr_accessor :created_at # An error object returned when the model fails to generate a Response. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseError)) } - def error - end + attr_reader :error - sig do - params(_: T.nilable(T.any(OpenAI::Models::Responses::ResponseError, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Responses::ResponseError, OpenAI::Util::AnyHash))) - end - def error=(_) - end + sig { params(error: T.nilable(T.any(OpenAI::Models::Responses::ResponseError, OpenAI::Util::AnyHash))).void } + attr_writer :error # Details about why the response is incomplete. sig { returns(T.nilable(OpenAI::Models::Responses::Response::IncompleteDetails)) } - def incomplete_details - end + attr_reader :incomplete_details sig do - params(_: T.nilable(T.any(OpenAI::Models::Responses::Response::IncompleteDetails, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Responses::Response::IncompleteDetails, OpenAI::Util::AnyHash))) - end - def incomplete_details=(_) + params( + incomplete_details: T.nilable(T.any(OpenAI::Models::Responses::Response::IncompleteDetails, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :incomplete_details # Inserts a system (or developer) message as the first item in the model's # context. @@ -53,12 +38,7 @@ module OpenAI # response will be not be carried over to the next response. This makes it simple # to swap out system (or developer) messages in new responses. sig { returns(T.nilable(String)) } - def instructions - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def instructions=(_) - end + attr_accessor :instructions # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -67,12 +47,7 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # Model ID used to generate the response, like `gpt-4o` or `o1`. OpenAI offers a # wide range of models with different capabilities, performance characteristics, @@ -84,28 +59,11 @@ module OpenAI T.any(String, OpenAI::Models::ChatModel::TaggedSymbol, OpenAI::Models::ResponsesModel::TaggedSymbol) ) end - def model - end - - sig do - params( - _: T.any(String, OpenAI::Models::ChatModel::TaggedSymbol, OpenAI::Models::ResponsesModel::TaggedSymbol) - ) - .returns( - T.any(String, OpenAI::Models::ChatModel::TaggedSymbol, OpenAI::Models::ResponsesModel::TaggedSymbol) - ) - end - def model=(_) - end + attr_accessor :model # The object type of this resource - always set to `response`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # An array of content items generated by the model. # @@ -128,58 +86,18 @@ module OpenAI ] ) end - def output - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseFunctionToolCall, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseReasoningItem - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseFunctionToolCall, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseReasoningItem - ) - ] - ) - end - def output=(_) - end + attr_accessor :output # Whether to allow the model to run tool calls in parallel. sig { returns(T::Boolean) } - def parallel_tool_calls - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def parallel_tool_calls=(_) - end + attr_accessor :parallel_tool_calls # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more # focused and deterministic. We generally recommend altering this or `top_p` but # not both. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # How the model should select which tool (or tools) to use when generating a # response. See the `tools` parameter to see how to specify which tools the model @@ -193,27 +111,7 @@ module OpenAI ) ) end - def tool_choice - end - - sig do - params( - _: T.any( - OpenAI::Models::Responses::ToolChoiceOptions::TaggedSymbol, - OpenAI::Models::Responses::ToolChoiceTypes, - OpenAI::Models::Responses::ToolChoiceFunction - ) - ) - .returns( - T.any( - OpenAI::Models::Responses::ToolChoiceOptions::TaggedSymbol, - OpenAI::Models::Responses::ToolChoiceTypes, - OpenAI::Models::Responses::ToolChoiceFunction - ) - ) - end - def tool_choice=(_) - end + attr_accessor :tool_choice # An array of tools the model may call while generating a response. You can # specify which tool to use by setting the `tool_choice` parameter. @@ -241,33 +139,7 @@ module OpenAI ] ) end - def tools - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Responses::FileSearchTool, - OpenAI::Models::Responses::FunctionTool, - OpenAI::Models::Responses::ComputerTool, - OpenAI::Models::Responses::WebSearchTool - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::FileSearchTool, - OpenAI::Models::Responses::FunctionTool, - OpenAI::Models::Responses::ComputerTool, - OpenAI::Models::Responses::WebSearchTool - ) - ] - ) - end - def tools=(_) - end + attr_accessor :tools # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -275,62 +147,37 @@ module OpenAI # # We generally recommend altering this or `temperature` but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p # An upper bound for the number of tokens that can be generated for a response, # including visible output tokens and # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). sig { returns(T.nilable(Integer)) } - def max_output_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_output_tokens=(_) - end + attr_accessor :max_output_tokens # The unique ID of the previous response to the model. Use this to create # multi-turn conversations. Learn more about # [conversation state](https://platform.openai.com/docs/guides/conversation-state). sig { returns(T.nilable(String)) } - def previous_response_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def previous_response_id=(_) - end + attr_accessor :previous_response_id # **o-series models only** # # Configuration options for # [reasoning models](https://platform.openai.com/docs/guides/reasoning). sig { returns(T.nilable(OpenAI::Models::Reasoning)) } - def reasoning - end + attr_reader :reasoning - sig do - params(_: T.nilable(T.any(OpenAI::Models::Reasoning, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Reasoning, OpenAI::Util::AnyHash))) - end - def reasoning=(_) - end + sig { params(reasoning: T.nilable(T.any(OpenAI::Models::Reasoning, OpenAI::Util::AnyHash))).void } + attr_writer :reasoning # The status of the response generation. One of `completed`, `failed`, # `in_progress`, or `incomplete`. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseStatus::TaggedSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseStatus::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseStatus::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseStatus::OrSymbol).void } + attr_writer :status # Configuration options for a text response from the model. Can be plain text or # structured JSON data. Learn more: @@ -338,15 +185,10 @@ module OpenAI # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) # - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) sig { returns(T.nilable(OpenAI::Models::Responses::ResponseTextConfig)) } - def text - end + attr_reader :text - sig do - params(_: T.any(OpenAI::Models::Responses::ResponseTextConfig, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::ResponseTextConfig, OpenAI::Util::AnyHash)) - end - def text=(_) - end + sig { params(text: T.any(OpenAI::Models::Responses::ResponseTextConfig, OpenAI::Util::AnyHash)).void } + attr_writer :text # The truncation strategy to use for the model response. # @@ -356,39 +198,24 @@ module OpenAI # - `disabled` (default): If a model response will exceed the context window size # for a model, the request will fail with a 400 error. sig { returns(T.nilable(OpenAI::Models::Responses::Response::Truncation::TaggedSymbol)) } - def truncation - end - - sig do - params(_: T.nilable(OpenAI::Models::Responses::Response::Truncation::TaggedSymbol)) - .returns(T.nilable(OpenAI::Models::Responses::Response::Truncation::TaggedSymbol)) - end - def truncation=(_) - end + attr_accessor :truncation # Represents token usage details including input tokens, output tokens, a # breakdown of output tokens, and the total tokens used. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseUsage)) } - def usage - end + attr_reader :usage - sig do - params(_: T.any(OpenAI::Models::Responses::ResponseUsage, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::ResponseUsage, OpenAI::Util::AnyHash)) - end - def usage=(_) - end + sig { params(usage: T.any(OpenAI::Models::Responses::ResponseUsage, OpenAI::Util::AnyHash)).void } + attr_writer :usage # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). sig { returns(T.nilable(String)) } - def user - end + attr_reader :user - sig { params(_: String).returns(String) } - def user=(_) - end + sig { params(user: String).void } + attr_writer :user sig do params( @@ -521,15 +348,10 @@ module OpenAI class IncompleteDetails < OpenAI::BaseModel # The reason why the response is incomplete. sig { returns(T.nilable(OpenAI::Models::Responses::Response::IncompleteDetails::Reason::TaggedSymbol)) } - def reason - end + attr_reader :reason - sig do - params(_: OpenAI::Models::Responses::Response::IncompleteDetails::Reason::OrSymbol) - .returns(OpenAI::Models::Responses::Response::IncompleteDetails::Reason::OrSymbol) - end - def reason=(_) - end + sig { params(reason: OpenAI::Models::Responses::Response::IncompleteDetails::Reason::OrSymbol).void } + attr_writer :reason # Details about why the response is incomplete. sig do diff --git a/rbi/lib/openai/models/responses/response_audio_delta_event.rbi b/rbi/lib/openai/models/responses/response_audio_delta_event.rbi index 54ec9c86..af937de8 100644 --- a/rbi/lib/openai/models/responses/response_audio_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_audio_delta_event.rbi @@ -6,21 +6,11 @@ module OpenAI class ResponseAudioDeltaEvent < OpenAI::BaseModel # A chunk of Base64 encoded response audio bytes. sig { returns(String) } - def delta - end - - sig { params(_: String).returns(String) } - def delta=(_) - end + attr_accessor :delta # The type of the event. Always `response.audio.delta`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when there is a partial audio response. sig { params(delta: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_audio_done_event.rbi b/rbi/lib/openai/models/responses/response_audio_done_event.rbi index d60d8ffe..2f302c28 100644 --- a/rbi/lib/openai/models/responses/response_audio_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_audio_done_event.rbi @@ -6,12 +6,7 @@ module OpenAI class ResponseAudioDoneEvent < OpenAI::BaseModel # The type of the event. Always `response.audio.done`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when the audio response is complete. sig { params(type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi b/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi index 072b6541..f2206761 100644 --- a/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_audio_transcript_delta_event.rbi @@ -6,21 +6,11 @@ module OpenAI class ResponseAudioTranscriptDeltaEvent < OpenAI::BaseModel # The partial transcript of the audio response. sig { returns(String) } - def delta - end - - sig { params(_: String).returns(String) } - def delta=(_) - end + attr_accessor :delta # The type of the event. Always `response.audio.transcript.delta`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when there is a partial transcript of audio. sig { params(delta: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi b/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi index 940f3497..cb69a888 100644 --- a/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_audio_transcript_done_event.rbi @@ -6,12 +6,7 @@ module OpenAI class ResponseAudioTranscriptDoneEvent < OpenAI::BaseModel # The type of the event. Always `response.audio.transcript.done`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when the full audio transcript is completed. sig { params(type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi index 21d55044..26d256d8 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseCodeInterpreterCallCodeDeltaEvent < OpenAI::BaseModel # The partial code snippet added by the code interpreter. sig { returns(String) } - def delta - end - - sig { params(_: String).returns(String) } - def delta=(_) - end + attr_accessor :delta # The index of the output item that the code interpreter call is in progress. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.code_interpreter_call.code.delta`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a partial code snippet is added by the code interpreter. sig { params(delta: String, output_index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi index 294664ab..c1512e6a 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseCodeInterpreterCallCodeDoneEvent < OpenAI::BaseModel # The final code snippet output by the code interpreter. sig { returns(String) } - def code - end - - sig { params(_: String).returns(String) } - def code=(_) - end + attr_accessor :code # The index of the output item that the code interpreter call is in progress. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.code_interpreter_call.code.done`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when code snippet output is finalized by the code interpreter. sig { params(code: String, output_index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi index 7001c9c4..ea6117b4 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_completed_event.rbi @@ -6,33 +6,23 @@ module OpenAI class ResponseCodeInterpreterCallCompletedEvent < OpenAI::BaseModel # A tool call to run code. sig { returns(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall) } - def code_interpreter_call - end + attr_reader :code_interpreter_call sig do - params(_: T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash)) - end - def code_interpreter_call=(_) + params( + code_interpreter_call: T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :code_interpreter_call # The index of the output item that the code interpreter call is in progress. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.code_interpreter_call.completed`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when the code interpreter call is completed. sig do diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi index 8d4c4c6f..7bc859d9 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi @@ -6,33 +6,23 @@ module OpenAI class ResponseCodeInterpreterCallInProgressEvent < OpenAI::BaseModel # A tool call to run code. sig { returns(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall) } - def code_interpreter_call - end + attr_reader :code_interpreter_call sig do - params(_: T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash)) - end - def code_interpreter_call=(_) + params( + code_interpreter_call: T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :code_interpreter_call # The index of the output item that the code interpreter call is in progress. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.code_interpreter_call.in_progress`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a code interpreter call is in progress. sig do diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi index 533e28c5..9788b54f 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi @@ -6,33 +6,23 @@ module OpenAI class ResponseCodeInterpreterCallInterpretingEvent < OpenAI::BaseModel # A tool call to run code. sig { returns(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall) } - def code_interpreter_call - end + attr_reader :code_interpreter_call sig do - params(_: T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash)) - end - def code_interpreter_call=(_) + params( + code_interpreter_call: T.any(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :code_interpreter_call # The index of the output item that the code interpreter call is in progress. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.code_interpreter_call.interpreting`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when the code interpreter is actively interpreting the code snippet. sig do diff --git a/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi b/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi index 0e9fda65..9ddb15ba 100644 --- a/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi +++ b/rbi/lib/openai/models/responses/response_code_interpreter_tool_call.rbi @@ -6,21 +6,11 @@ module OpenAI class ResponseCodeInterpreterToolCall < OpenAI::BaseModel # The unique ID of the code interpreter tool call. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The code to run. sig { returns(String) } - def code - end - - sig { params(_: String).returns(String) } - def code=(_) - end + attr_accessor :code # The results of the code interpreter tool call. sig do @@ -33,50 +23,15 @@ module OpenAI ] ) end - def results - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Logs, - OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Files - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Logs, - OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Files - ) - ] - ) - end - def results=(_) - end + attr_accessor :results # The status of the code interpreter tool call. sig { returns(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Status::TaggedSymbol) - .returns(OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The type of the code interpreter tool call. Always `code_interpreter_call`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A tool call to run code. sig do @@ -135,21 +90,11 @@ module OpenAI class Logs < OpenAI::BaseModel # The logs of the code interpreter tool call. sig { returns(String) } - def logs - end - - sig { params(_: String).returns(String) } - def logs=(_) - end + attr_accessor :logs # The type of the code interpreter text output. Always `logs`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The output of a code interpreter tool call that is text. sig { params(logs: String, type: Symbol).returns(T.attached_class) } @@ -163,24 +108,11 @@ module OpenAI class Files < OpenAI::BaseModel sig { returns(T::Array[OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Files::File]) } - def files - end - - sig do - params(_: T::Array[OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Files::File]) - .returns(T::Array[OpenAI::Models::Responses::ResponseCodeInterpreterToolCall::Result::Files::File]) - end - def files=(_) - end + attr_accessor :files # The type of the code interpreter file output. Always `files`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The output of a code interpreter tool call that is a file. sig do @@ -213,21 +145,11 @@ module OpenAI class File < OpenAI::BaseModel # The ID of the file. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # The MIME type of the file. sig { returns(String) } - def mime_type - end - - sig { params(_: String).returns(String) } - def mime_type=(_) - end + attr_accessor :mime_type sig { params(file_id: String, mime_type: String).returns(T.attached_class) } def self.new(file_id:, mime_type:) diff --git a/rbi/lib/openai/models/responses/response_completed_event.rbi b/rbi/lib/openai/models/responses/response_completed_event.rbi index 8cbd9bea..4b78bb8f 100644 --- a/rbi/lib/openai/models/responses/response_completed_event.rbi +++ b/rbi/lib/openai/models/responses/response_completed_event.rbi @@ -6,24 +6,14 @@ module OpenAI class ResponseCompletedEvent < OpenAI::BaseModel # Properties of the completed response. sig { returns(OpenAI::Models::Responses::Response) } - def response - end + attr_reader :response - sig do - params(_: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - end - def response=(_) - end + sig { params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)).void } + attr_writer :response # The type of the event. Always `response.completed`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when the model response is complete. sig do diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call.rbi b/rbi/lib/openai/models/responses/response_computer_tool_call.rbi index f3845301..205f7f16 100644 --- a/rbi/lib/openai/models/responses/response_computer_tool_call.rbi +++ b/rbi/lib/openai/models/responses/response_computer_tool_call.rbi @@ -6,12 +6,7 @@ module OpenAI class ResponseComputerToolCall < OpenAI::BaseModel # The unique ID of the computer call. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # A click action. sig do @@ -29,85 +24,24 @@ module OpenAI ) ) end - def action - end - - sig do - params( - _: T.any( - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::DoubleClick, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Keypress, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Move, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Screenshot, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Scroll, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Type, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Wait - ) - ) - .returns( - T.any( - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::DoubleClick, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Keypress, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Move, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Screenshot, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Scroll, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Type, - OpenAI::Models::Responses::ResponseComputerToolCall::Action::Wait - ) - ) - end - def action=(_) - end + attr_accessor :action # An identifier used when responding to the tool call with output. sig { returns(String) } - def call_id - end - - sig { params(_: String).returns(String) } - def call_id=(_) - end + attr_accessor :call_id # The pending safety checks for the computer call. sig { returns(T::Array[OpenAI::Models::Responses::ResponseComputerToolCall::PendingSafetyCheck]) } - def pending_safety_checks - end - - sig do - params(_: T::Array[OpenAI::Models::Responses::ResponseComputerToolCall::PendingSafetyCheck]) - .returns(T::Array[OpenAI::Models::Responses::ResponseComputerToolCall::PendingSafetyCheck]) - end - def pending_safety_checks=(_) - end + attr_accessor :pending_safety_checks # The status of the item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. sig { returns(OpenAI::Models::Responses::ResponseComputerToolCall::Status::OrSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Responses::ResponseComputerToolCall::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseComputerToolCall::Status::OrSymbol) - end - def status=(_) - end + attr_accessor :status # The type of the computer call. Always `computer_call`. sig { returns(OpenAI::Models::Responses::ResponseComputerToolCall::Type::OrSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::Responses::ResponseComputerToolCall::Type::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseComputerToolCall::Type::OrSymbol) - end - def type=(_) - end + attr_accessor :type # A tool call to a computer use tool. See the # [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) @@ -188,43 +122,20 @@ module OpenAI # Indicates which mouse button was pressed during the click. One of `left`, # `right`, `wheel`, `back`, or `forward`. sig { returns(OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click::Button::OrSymbol) } - def button - end - - sig do - params(_: OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click::Button::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseComputerToolCall::Action::Click::Button::OrSymbol) - end - def button=(_) - end + attr_accessor :button # Specifies the event type. For a click action, this property is always set to # `click`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The x-coordinate where the click occurred. sig { returns(Integer) } - def x - end - - sig { params(_: Integer).returns(Integer) } - def x=(_) - end + attr_accessor :x # The y-coordinate where the click occurred. sig { returns(Integer) } - def y_ - end - - sig { params(_: Integer).returns(Integer) } - def y_=(_) - end + attr_accessor :y_ # A click action. sig do @@ -291,30 +202,15 @@ module OpenAI # Specifies the event type. For a double click action, this property is always set # to `double_click`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The x-coordinate where the double click occurred. sig { returns(Integer) } - def x - end - - sig { params(_: Integer).returns(Integer) } - def x=(_) - end + attr_accessor :x # The y-coordinate where the double click occurred. sig { returns(Integer) } - def y_ - end - - sig { params(_: Integer).returns(Integer) } - def y_=(_) - end + attr_accessor :y_ # A double click action. sig { params(x: Integer, y_: Integer, type: Symbol).returns(T.attached_class) } @@ -337,25 +233,12 @@ module OpenAI # ] # ``` sig { returns(T::Array[OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag::Path]) } - def path - end - - sig do - params(_: T::Array[OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag::Path]) - .returns(T::Array[OpenAI::Models::Responses::ResponseComputerToolCall::Action::Drag::Path]) - end - def path=(_) - end + attr_accessor :path # Specifies the event type. For a drag action, this property is always set to # `drag`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A drag action. sig do @@ -380,21 +263,11 @@ module OpenAI class Path < OpenAI::BaseModel # The x-coordinate. sig { returns(Integer) } - def x - end - - sig { params(_: Integer).returns(Integer) } - def x=(_) - end + attr_accessor :x # The y-coordinate. sig { returns(Integer) } - def y_ - end - - sig { params(_: Integer).returns(Integer) } - def y_=(_) - end + attr_accessor :y_ # A series of x/y coordinate pairs in the drag path. sig { params(x: Integer, y_: Integer).returns(T.attached_class) } @@ -411,22 +284,12 @@ module OpenAI # The combination of keys the model is requesting to be pressed. This is an array # of strings, each representing a key. sig { returns(T::Array[String]) } - def keys - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def keys=(_) - end + attr_accessor :keys # Specifies the event type. For a keypress action, this property is always set to # `keypress`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A collection of keypresses the model would like to perform. sig { params(keys: T::Array[String], type: Symbol).returns(T.attached_class) } @@ -442,30 +305,15 @@ module OpenAI # Specifies the event type. For a move action, this property is always set to # `move`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The x-coordinate to move to. sig { returns(Integer) } - def x - end - - sig { params(_: Integer).returns(Integer) } - def x=(_) - end + attr_accessor :x # The y-coordinate to move to. sig { returns(Integer) } - def y_ - end - - sig { params(_: Integer).returns(Integer) } - def y_=(_) - end + attr_accessor :y_ # A mouse move action. sig { params(x: Integer, y_: Integer, type: Symbol).returns(T.attached_class) } @@ -481,12 +329,7 @@ module OpenAI # Specifies the event type. For a screenshot action, this property is always set # to `screenshot`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A screenshot action. sig { params(type: Symbol).returns(T.attached_class) } @@ -501,49 +344,24 @@ module OpenAI class Scroll < OpenAI::BaseModel # The horizontal scroll distance. sig { returns(Integer) } - def scroll_x - end - - sig { params(_: Integer).returns(Integer) } - def scroll_x=(_) - end + attr_accessor :scroll_x # The vertical scroll distance. sig { returns(Integer) } - def scroll_y - end - - sig { params(_: Integer).returns(Integer) } - def scroll_y=(_) - end + attr_accessor :scroll_y # Specifies the event type. For a scroll action, this property is always set to # `scroll`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The x-coordinate where the scroll occurred. sig { returns(Integer) } - def x - end - - sig { params(_: Integer).returns(Integer) } - def x=(_) - end + attr_accessor :x # The y-coordinate where the scroll occurred. sig { returns(Integer) } - def y_ - end - - sig { params(_: Integer).returns(Integer) } - def y_=(_) - end + attr_accessor :y_ # A scroll action. sig do @@ -563,22 +381,12 @@ module OpenAI class Type < OpenAI::BaseModel # The text to type. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # Specifies the event type. For a type action, this property is always set to # `type`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An action to type in text. sig { params(text: String, type: Symbol).returns(T.attached_class) } @@ -594,12 +402,7 @@ module OpenAI # Specifies the event type. For a wait action, this property is always set to # `wait`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A wait action. sig { params(type: Symbol).returns(T.attached_class) } @@ -626,30 +429,15 @@ module OpenAI class PendingSafetyCheck < OpenAI::BaseModel # The ID of the pending safety check. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The type of the pending safety check. sig { returns(String) } - def code - end - - sig { params(_: String).returns(String) } - def code=(_) - end + attr_accessor :code # Details about the pending safety check. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # A pending safety check for the computer call. sig { params(id: String, code: String, message: String).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi b/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi index 93d2029f..84261381 100644 --- a/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi +++ b/rbi/lib/openai/models/responses/response_computer_tool_call_output_item.rbi @@ -6,44 +6,27 @@ module OpenAI class ResponseComputerToolCallOutputItem < OpenAI::BaseModel # The unique ID of the computer call tool output. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The ID of the computer tool call that produced the output. sig { returns(String) } - def call_id - end - - sig { params(_: String).returns(String) } - def call_id=(_) - end + attr_accessor :call_id # A computer screenshot image used with the computer use tool. sig { returns(OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot) } - def output - end + attr_reader :output sig do params( - _: T.any(OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot, OpenAI::Util::AnyHash) + output: T.any(OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot, OpenAI::Util::AnyHash) ) - .returns(T.any(OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot, OpenAI::Util::AnyHash)) - end - def output=(_) + .void end + attr_writer :output # The type of the computer tool call output. Always `computer_call_output`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The safety checks reported by the API that have been acknowledged by the # developer. @@ -54,42 +37,28 @@ module OpenAI ) ) end - def acknowledged_safety_checks - end + attr_reader :acknowledged_safety_checks sig do params( - _: T::Array[ + acknowledged_safety_checks: T::Array[ T.any( OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::AcknowledgedSafetyCheck, OpenAI::Util::AnyHash ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::AcknowledgedSafetyCheck, - OpenAI::Util::AnyHash - ) - ] - ) - end - def acknowledged_safety_checks=(_) + .void end + attr_writer :acknowledged_safety_checks # The status of the message input. One of `in_progress`, `completed`, or # `incomplete`. Populated when input items are returned via API. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::Status::TaggedSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::Status::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseComputerToolCallOutputItem::Status::OrSymbol).void } + attr_writer :status sig do params( @@ -129,30 +98,15 @@ module OpenAI class AcknowledgedSafetyCheck < OpenAI::BaseModel # The ID of the pending safety check. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The type of the pending safety check. sig { returns(String) } - def code - end - - sig { params(_: String).returns(String) } - def code=(_) - end + attr_accessor :code # Details about the pending safety check. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # A pending safety check for the computer call. sig { params(id: String, code: String, message: String).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi b/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi index 7b4d757f..1246a3c0 100644 --- a/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi +++ b/rbi/lib/openai/models/responses/response_computer_tool_call_output_screenshot.rbi @@ -7,30 +7,21 @@ module OpenAI # Specifies the event type. For a computer screenshot, this property is always set # to `computer_screenshot`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The identifier of an uploaded file that contains the screenshot. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The URL of the screenshot image. sig { returns(T.nilable(String)) } - def image_url - end + attr_reader :image_url - sig { params(_: String).returns(String) } - def image_url=(_) - end + sig { params(image_url: String).void } + attr_writer :image_url # A computer screenshot image used with the computer use tool. sig { params(file_id: String, image_url: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_content_part_added_event.rbi b/rbi/lib/openai/models/responses/response_content_part_added_event.rbi index b7e8bd20..9b96ae2c 100644 --- a/rbi/lib/openai/models/responses/response_content_part_added_event.rbi +++ b/rbi/lib/openai/models/responses/response_content_part_added_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseContentPartAddedEvent < OpenAI::BaseModel # The index of the content part that was added. sig { returns(Integer) } - def content_index - end - - sig { params(_: Integer).returns(Integer) } - def content_index=(_) - end + attr_accessor :content_index # The ID of the output item that the content part was added to. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the content part was added to. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The content part that was added. sig do @@ -37,28 +22,11 @@ module OpenAI T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal) ) end - def part - end - - sig do - params( - _: T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal) - ) - .returns( - T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal) - ) - end - def part=(_) - end + attr_accessor :part # The type of the event. Always `response.content_part.added`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a new content part is added. sig do diff --git a/rbi/lib/openai/models/responses/response_content_part_done_event.rbi b/rbi/lib/openai/models/responses/response_content_part_done_event.rbi index 566da131..5c70029a 100644 --- a/rbi/lib/openai/models/responses/response_content_part_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_content_part_done_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseContentPartDoneEvent < OpenAI::BaseModel # The index of the content part that is done. sig { returns(Integer) } - def content_index - end - - sig { params(_: Integer).returns(Integer) } - def content_index=(_) - end + attr_accessor :content_index # The ID of the output item that the content part was added to. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the content part was added to. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The content part that is done. sig do @@ -37,28 +22,11 @@ module OpenAI T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal) ) end - def part - end - - sig do - params( - _: T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal) - ) - .returns( - T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal) - ) - end - def part=(_) - end + attr_accessor :part # The type of the event. Always `response.content_part.done`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a content part is done. sig do diff --git a/rbi/lib/openai/models/responses/response_create_params.rbi b/rbi/lib/openai/models/responses/response_create_params.rbi index 9cf8f37d..10786b61 100644 --- a/rbi/lib/openai/models/responses/response_create_params.rbi +++ b/rbi/lib/openai/models/responses/response_create_params.rbi @@ -38,53 +38,7 @@ module OpenAI ) ) end - def input - end - - sig do - params( - _: T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Responses::EasyInputMessage, - OpenAI::Models::Responses::ResponseInputItem::Message, - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseFunctionToolCall, - OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput, - OpenAI::Models::Responses::ResponseReasoningItem, - OpenAI::Models::Responses::ResponseInputItem::ItemReference - ) - ] - ) - ) - .returns( - T.any( - String, - T::Array[ - T.any( - OpenAI::Models::Responses::EasyInputMessage, - OpenAI::Models::Responses::ResponseInputItem::Message, - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseFunctionToolCall, - OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput, - OpenAI::Models::Responses::ResponseReasoningItem, - OpenAI::Models::Responses::ResponseInputItem::ItemReference - ) - ] - ) - ) - end - def input=(_) - end + attr_accessor :input # Model ID used to generate the response, like `gpt-4o` or `o1`. OpenAI offers a # wide range of models with different capabilities, performance characteristics, @@ -92,15 +46,7 @@ module OpenAI # [model guide](https://platform.openai.com/docs/models) to browse and compare # available models. sig { returns(T.any(String, OpenAI::Models::ChatModel::OrSymbol, OpenAI::Models::ResponsesModel::OrSymbol)) } - def model - end - - sig do - params(_: T.any(String, OpenAI::Models::ChatModel::OrSymbol, OpenAI::Models::ResponsesModel::OrSymbol)) - .returns(T.any(String, OpenAI::Models::ChatModel::OrSymbol, OpenAI::Models::ResponsesModel::OrSymbol)) - end - def model=(_) - end + attr_accessor :model # Specify additional output data to include in the model response. Currently # supported values are: @@ -111,15 +57,7 @@ module OpenAI # - `computer_call_output.output.image_url`: Include image urls from the computer # call output. sig { returns(T.nilable(T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol])) } - def include - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol])) - .returns(T.nilable(T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol])) - end - def include=(_) - end + attr_accessor :include # Inserts a system (or developer) message as the first item in the model's # context. @@ -128,23 +66,13 @@ module OpenAI # response will be not be carried over to the next response. This makes it simple # to swap out system (or developer) messages in new responses. sig { returns(T.nilable(String)) } - def instructions - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def instructions=(_) - end + attr_accessor :instructions # An upper bound for the number of tokens that can be generated for a response, # including visible output tokens and # [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). sig { returns(T.nilable(Integer)) } - def max_output_tokens - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_output_tokens=(_) - end + attr_accessor :max_output_tokens # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -153,68 +81,38 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # Whether to allow the model to run tool calls in parallel. sig { returns(T.nilable(T::Boolean)) } - def parallel_tool_calls - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def parallel_tool_calls=(_) - end + attr_accessor :parallel_tool_calls # The unique ID of the previous response to the model. Use this to create # multi-turn conversations. Learn more about # [conversation state](https://platform.openai.com/docs/guides/conversation-state). sig { returns(T.nilable(String)) } - def previous_response_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def previous_response_id=(_) - end + attr_accessor :previous_response_id # **o-series models only** # # Configuration options for # [reasoning models](https://platform.openai.com/docs/guides/reasoning). sig { returns(T.nilable(OpenAI::Models::Reasoning)) } - def reasoning - end + attr_reader :reasoning - sig do - params(_: T.nilable(T.any(OpenAI::Models::Reasoning, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Reasoning, OpenAI::Util::AnyHash))) - end - def reasoning=(_) - end + sig { params(reasoning: T.nilable(T.any(OpenAI::Models::Reasoning, OpenAI::Util::AnyHash))).void } + attr_writer :reasoning # Whether to store the generated model response for later retrieval via API. sig { returns(T.nilable(T::Boolean)) } - def store - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def store=(_) - end + attr_accessor :store # What sampling temperature to use, between 0 and 2. Higher values like 0.8 will # make the output more random, while lower values like 0.2 will make it more # focused and deterministic. We generally recommend altering this or `top_p` but # not both. sig { returns(T.nilable(Float)) } - def temperature - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def temperature=(_) - end + attr_accessor :temperature # Configuration options for a text response from the model. Can be plain text or # structured JSON data. Learn more: @@ -222,15 +120,10 @@ module OpenAI # - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) # - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) sig { returns(T.nilable(OpenAI::Models::Responses::ResponseTextConfig)) } - def text - end + attr_reader :text - sig do - params(_: T.any(OpenAI::Models::Responses::ResponseTextConfig, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::ResponseTextConfig, OpenAI::Util::AnyHash)) - end - def text=(_) - end + sig { params(text: T.any(OpenAI::Models::Responses::ResponseTextConfig, OpenAI::Util::AnyHash)).void } + attr_writer :text # How the model should select which tool (or tools) to use when generating a # response. See the `tools` parameter to see how to specify which tools the model @@ -246,29 +139,20 @@ module OpenAI ) ) end - def tool_choice - end + attr_reader :tool_choice sig do params( - _: T.any( + tool_choice: T.any( OpenAI::Models::Responses::ToolChoiceOptions::OrSymbol, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Util::AnyHash, OpenAI::Models::Responses::ToolChoiceFunction ) ) - .returns( - T.any( - OpenAI::Models::Responses::ToolChoiceOptions::OrSymbol, - OpenAI::Models::Responses::ToolChoiceTypes, - OpenAI::Util::AnyHash, - OpenAI::Models::Responses::ToolChoiceFunction - ) - ) - end - def tool_choice=(_) + .void end + attr_writer :tool_choice # An array of tools the model may call while generating a response. You can # specify which tool to use by setting the `tool_choice` parameter. @@ -298,12 +182,11 @@ module OpenAI ) ) end - def tools - end + attr_reader :tools sig do params( - _: T::Array[ + tools: T::Array[ T.any( OpenAI::Models::Responses::FileSearchTool, OpenAI::Util::AnyHash, @@ -313,20 +196,9 @@ module OpenAI ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::FileSearchTool, - OpenAI::Util::AnyHash, - OpenAI::Models::Responses::FunctionTool, - OpenAI::Models::Responses::ComputerTool, - OpenAI::Models::Responses::WebSearchTool - ) - ] - ) - end - def tools=(_) + .void end + attr_writer :tools # An alternative to sampling with temperature, called nucleus sampling, where the # model considers the results of the tokens with top_p probability mass. So 0.1 @@ -334,12 +206,7 @@ module OpenAI # # We generally recommend altering this or `temperature` but not both. sig { returns(T.nilable(Float)) } - def top_p - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def top_p=(_) - end + attr_accessor :top_p # The truncation strategy to use for the model response. # @@ -349,26 +216,16 @@ module OpenAI # - `disabled` (default): If a model response will exceed the context window size # for a model, the request will fail with a 400 error. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseCreateParams::Truncation::OrSymbol)) } - def truncation - end - - sig do - params(_: T.nilable(OpenAI::Models::Responses::ResponseCreateParams::Truncation::OrSymbol)) - .returns(T.nilable(OpenAI::Models::Responses::ResponseCreateParams::Truncation::OrSymbol)) - end - def truncation=(_) - end + attr_accessor :truncation # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. # [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). sig { returns(T.nilable(String)) } - def user - end + attr_reader :user - sig { params(_: String).returns(String) } - def user=(_) - end + sig { params(user: String).void } + attr_writer :user sig do params( diff --git a/rbi/lib/openai/models/responses/response_created_event.rbi b/rbi/lib/openai/models/responses/response_created_event.rbi index 58257a17..0ff42037 100644 --- a/rbi/lib/openai/models/responses/response_created_event.rbi +++ b/rbi/lib/openai/models/responses/response_created_event.rbi @@ -6,24 +6,14 @@ module OpenAI class ResponseCreatedEvent < OpenAI::BaseModel # The response that was created. sig { returns(OpenAI::Models::Responses::Response) } - def response - end + attr_reader :response - sig do - params(_: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - end - def response=(_) - end + sig { params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)).void } + attr_writer :response # The type of the event. Always `response.created`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An event that is emitted when a response is created. sig do diff --git a/rbi/lib/openai/models/responses/response_error.rbi b/rbi/lib/openai/models/responses/response_error.rbi index 8b28aae4..18462364 100644 --- a/rbi/lib/openai/models/responses/response_error.rbi +++ b/rbi/lib/openai/models/responses/response_error.rbi @@ -6,24 +6,11 @@ module OpenAI class ResponseError < OpenAI::BaseModel # The error code for the response. sig { returns(OpenAI::Models::Responses::ResponseError::Code::TaggedSymbol) } - def code - end - - sig do - params(_: OpenAI::Models::Responses::ResponseError::Code::TaggedSymbol) - .returns(OpenAI::Models::Responses::ResponseError::Code::TaggedSymbol) - end - def code=(_) - end + attr_accessor :code # A human-readable description of the error. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # An error object returned when the model fails to generate a Response. sig do diff --git a/rbi/lib/openai/models/responses/response_error_event.rbi b/rbi/lib/openai/models/responses/response_error_event.rbi index f4c0e9f0..303a0210 100644 --- a/rbi/lib/openai/models/responses/response_error_event.rbi +++ b/rbi/lib/openai/models/responses/response_error_event.rbi @@ -6,39 +6,19 @@ module OpenAI class ResponseErrorEvent < OpenAI::BaseModel # The error code. sig { returns(T.nilable(String)) } - def code - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def code=(_) - end + attr_accessor :code # The error message. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # The error parameter. sig { returns(T.nilable(String)) } - def param - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def param=(_) - end + attr_accessor :param # The type of the event. Always `error`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when an error occurs. sig do diff --git a/rbi/lib/openai/models/responses/response_failed_event.rbi b/rbi/lib/openai/models/responses/response_failed_event.rbi index 7409c35c..8a3b97e1 100644 --- a/rbi/lib/openai/models/responses/response_failed_event.rbi +++ b/rbi/lib/openai/models/responses/response_failed_event.rbi @@ -6,24 +6,14 @@ module OpenAI class ResponseFailedEvent < OpenAI::BaseModel # The response that failed. sig { returns(OpenAI::Models::Responses::Response) } - def response - end + attr_reader :response - sig do - params(_: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - end - def response=(_) - end + sig { params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)).void } + attr_writer :response # The type of the event. Always `response.failed`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An event that is emitted when a response fails. sig do diff --git a/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi b/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi index ffb5cae7..fd8d4c62 100644 --- a/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi +++ b/rbi/lib/openai/models/responses/response_file_search_call_completed_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseFileSearchCallCompletedEvent < OpenAI::BaseModel # The ID of the output item that the file search call is initiated. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the file search call is initiated. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.file_search_call.completed`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a file search call is completed (results found). sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi b/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi index 2feeebed..621c0706 100644 --- a/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi +++ b/rbi/lib/openai/models/responses/response_file_search_call_in_progress_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseFileSearchCallInProgressEvent < OpenAI::BaseModel # The ID of the output item that the file search call is initiated. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the file search call is initiated. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.file_search_call.in_progress`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a file search call is initiated. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi b/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi index b340e2ff..849e6603 100644 --- a/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi +++ b/rbi/lib/openai/models/responses/response_file_search_call_searching_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseFileSearchCallSearchingEvent < OpenAI::BaseModel # The ID of the output item that the file search call is initiated. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the file search call is searching. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.file_search_call.searching`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a file search is currently searching. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi b/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi index 957f8061..7355cae9 100644 --- a/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi +++ b/rbi/lib/openai/models/responses/response_file_search_tool_call.rbi @@ -6,55 +6,24 @@ module OpenAI class ResponseFileSearchToolCall < OpenAI::BaseModel # The unique ID of the file search tool call. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The queries used to search for files. sig { returns(T::Array[String]) } - def queries - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def queries=(_) - end + attr_accessor :queries # The status of the file search tool call. One of `in_progress`, `searching`, # `incomplete` or `failed`, sig { returns(OpenAI::Models::Responses::ResponseFileSearchToolCall::Status::OrSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Responses::ResponseFileSearchToolCall::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseFileSearchToolCall::Status::OrSymbol) - end - def status=(_) - end + attr_accessor :status # The type of the file search tool call. Always `file_search_call`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The results of the file search tool call. sig { returns(T.nilable(T::Array[OpenAI::Models::Responses::ResponseFileSearchToolCall::Result])) } - def results - end - - sig do - params(_: T.nilable(T::Array[OpenAI::Models::Responses::ResponseFileSearchToolCall::Result])) - .returns(T.nilable(T::Array[OpenAI::Models::Responses::ResponseFileSearchToolCall::Result])) - end - def results=(_) - end + attr_accessor :results # The results of a file search tool call. See the # [file search guide](https://platform.openai.com/docs/guides/tools-file-search) @@ -123,51 +92,35 @@ module OpenAI # length of 64 characters. Values are strings with a maximum length of 512 # characters, booleans, or numbers. sig { returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) } - def attributes - end - - sig do - params(_: T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - .returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - end - def attributes=(_) - end + attr_accessor :attributes # The unique ID of the file. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The name of the file. sig { returns(T.nilable(String)) } - def filename - end + attr_reader :filename - sig { params(_: String).returns(String) } - def filename=(_) - end + sig { params(filename: String).void } + attr_writer :filename # The relevance score of the file - a value between 0 and 1. sig { returns(T.nilable(Float)) } - def score - end + attr_reader :score - sig { params(_: Float).returns(Float) } - def score=(_) - end + sig { params(score: Float).void } + attr_writer :score # The text that was retrieved from the file. sig { returns(T.nilable(String)) } - def text - end + attr_reader :text - sig { params(_: String).returns(String) } - def text=(_) - end + sig { params(text: String).void } + attr_writer :text sig do params( diff --git a/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi b/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi index aab69ea5..8b4a57ef 100644 --- a/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi +++ b/rbi/lib/openai/models/responses/response_format_text_json_schema_config.rbi @@ -7,41 +7,27 @@ module OpenAI # The schema for the response format, described as a JSON Schema object. Learn how # to build JSON schemas [here](https://json-schema.org/). sig { returns(T::Hash[Symbol, T.anything]) } - def schema - end - - sig { params(_: T::Hash[Symbol, T.anything]).returns(T::Hash[Symbol, T.anything]) } - def schema=(_) - end + attr_accessor :schema # The type of response format being defined. Always `json_schema`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A description of what the response format is for, used by the model to determine # how to respond in the format. sig { returns(T.nilable(String)) } - def description - end + attr_reader :description - sig { params(_: String).returns(String) } - def description=(_) - end + sig { params(description: String).void } + attr_writer :description # The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores # and dashes, with a maximum length of 64. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name # Whether to enable strict schema adherence when generating the output. If set to # true, the model will always follow the exact schema defined in the `schema` @@ -49,12 +35,7 @@ module OpenAI # learn more, read the # [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). sig { returns(T.nilable(T::Boolean)) } - def strict - end - - sig { params(_: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } - def strict=(_) - end + attr_accessor :strict # JSON Schema response format. Used to generate structured JSON responses. Learn # more about diff --git a/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi b/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi index bd790e94..5aada226 100644 --- a/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_function_call_arguments_delta_event.rbi @@ -6,39 +6,19 @@ module OpenAI class ResponseFunctionCallArgumentsDeltaEvent < OpenAI::BaseModel # The function-call arguments delta that is added. sig { returns(String) } - def delta - end - - sig { params(_: String).returns(String) } - def delta=(_) - end + attr_accessor :delta # The ID of the output item that the function-call arguments delta is added to. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the function-call arguments delta is added to. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.function_call_arguments.delta`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when there is a partial function-call arguments delta. sig do diff --git a/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi b/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi index 48684e3e..ba8b13d1 100644 --- a/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_function_call_arguments_done_event.rbi @@ -6,38 +6,18 @@ module OpenAI class ResponseFunctionCallArgumentsDoneEvent < OpenAI::BaseModel # The function-call arguments. sig { returns(String) } - def arguments - end - - sig { params(_: String).returns(String) } - def arguments=(_) - end + attr_accessor :arguments # The ID of the item. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when function-call arguments are finalized. sig do diff --git a/rbi/lib/openai/models/responses/response_function_tool_call.rbi b/rbi/lib/openai/models/responses/response_function_tool_call.rbi index b721ef25..aab3c789 100644 --- a/rbi/lib/openai/models/responses/response_function_tool_call.rbi +++ b/rbi/lib/openai/models/responses/response_function_tool_call.rbi @@ -6,61 +6,34 @@ module OpenAI class ResponseFunctionToolCall < OpenAI::BaseModel # A JSON string of the arguments to pass to the function. sig { returns(String) } - def arguments - end - - sig { params(_: String).returns(String) } - def arguments=(_) - end + attr_accessor :arguments # The unique ID of the function tool call generated by the model. sig { returns(String) } - def call_id - end - - sig { params(_: String).returns(String) } - def call_id=(_) - end + attr_accessor :call_id # The name of the function to run. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # The type of the function tool call. Always `function_call`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The unique ID of the function tool call. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id # The status of the item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseFunctionToolCall::Status::OrSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseFunctionToolCall::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseFunctionToolCall::Status::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseFunctionToolCall::Status::OrSymbol).void } + attr_writer :status # A tool call to run a function. See the # [function calling guide](https://platform.openai.com/docs/guides/function-calling) diff --git a/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi b/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi index d0e917fc..8a6699fb 100644 --- a/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi +++ b/rbi/lib/openai/models/responses/response_function_tool_call_item.rbi @@ -6,12 +6,7 @@ module OpenAI class ResponseFunctionToolCallItem < OpenAI::Models::Responses::ResponseFunctionToolCall # The unique ID of the function tool call. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # A tool call to run a function. See the # [function calling guide](https://platform.openai.com/docs/guides/function-calling) diff --git a/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi b/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi index f78c8d84..fcbdc3a6 100644 --- a/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi +++ b/rbi/lib/openai/models/responses/response_function_tool_call_output_item.rbi @@ -6,52 +6,27 @@ module OpenAI class ResponseFunctionToolCallOutputItem < OpenAI::BaseModel # The unique ID of the function call tool output. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The unique ID of the function tool call generated by the model. sig { returns(String) } - def call_id - end - - sig { params(_: String).returns(String) } - def call_id=(_) - end + attr_accessor :call_id # A JSON string of the output of the function tool call. sig { returns(String) } - def output - end - - sig { params(_: String).returns(String) } - def output=(_) - end + attr_accessor :output # The type of the function tool call output. Always `function_call_output`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The status of the item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Status::TaggedSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Status::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem::Status::OrSymbol).void } + attr_writer :status sig do params( diff --git a/rbi/lib/openai/models/responses/response_function_web_search.rbi b/rbi/lib/openai/models/responses/response_function_web_search.rbi index 0fa5fadb..647bbe36 100644 --- a/rbi/lib/openai/models/responses/response_function_web_search.rbi +++ b/rbi/lib/openai/models/responses/response_function_web_search.rbi @@ -6,33 +6,15 @@ module OpenAI class ResponseFunctionWebSearch < OpenAI::BaseModel # The unique ID of the web search tool call. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The status of the web search tool call. sig { returns(OpenAI::Models::Responses::ResponseFunctionWebSearch::Status::OrSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Responses::ResponseFunctionWebSearch::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseFunctionWebSearch::Status::OrSymbol) - end - def status=(_) - end + attr_accessor :status # The type of the web search tool call. Always `web_search_call`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The results of a web search tool call. See the # [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for diff --git a/rbi/lib/openai/models/responses/response_in_progress_event.rbi b/rbi/lib/openai/models/responses/response_in_progress_event.rbi index f694955a..7895e6a8 100644 --- a/rbi/lib/openai/models/responses/response_in_progress_event.rbi +++ b/rbi/lib/openai/models/responses/response_in_progress_event.rbi @@ -6,24 +6,14 @@ module OpenAI class ResponseInProgressEvent < OpenAI::BaseModel # The response that is in progress. sig { returns(OpenAI::Models::Responses::Response) } - def response - end + attr_reader :response - sig do - params(_: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - end - def response=(_) - end + sig { params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)).void } + attr_writer :response # The type of the event. Always `response.in_progress`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when the response is in progress. sig do diff --git a/rbi/lib/openai/models/responses/response_incomplete_event.rbi b/rbi/lib/openai/models/responses/response_incomplete_event.rbi index 07ca324b..ea974ede 100644 --- a/rbi/lib/openai/models/responses/response_incomplete_event.rbi +++ b/rbi/lib/openai/models/responses/response_incomplete_event.rbi @@ -6,24 +6,14 @@ module OpenAI class ResponseIncompleteEvent < OpenAI::BaseModel # The response that was incomplete. sig { returns(OpenAI::Models::Responses::Response) } - def response - end + attr_reader :response - sig do - params(_: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)) - end - def response=(_) - end + sig { params(response: T.any(OpenAI::Models::Responses::Response, OpenAI::Util::AnyHash)).void } + attr_writer :response # The type of the event. Always `response.incomplete`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An event that is emitted when a response finishes as incomplete. sig do diff --git a/rbi/lib/openai/models/responses/response_input_audio.rbi b/rbi/lib/openai/models/responses/response_input_audio.rbi index e0768a09..c48ea4f2 100644 --- a/rbi/lib/openai/models/responses/response_input_audio.rbi +++ b/rbi/lib/openai/models/responses/response_input_audio.rbi @@ -6,33 +6,15 @@ module OpenAI class ResponseInputAudio < OpenAI::BaseModel # Base64-encoded audio data. sig { returns(String) } - def data - end - - sig { params(_: String).returns(String) } - def data=(_) - end + attr_accessor :data # The format of the audio data. Currently supported formats are `mp3` and `wav`. sig { returns(OpenAI::Models::Responses::ResponseInputAudio::Format::OrSymbol) } - def format_ - end - - sig do - params(_: OpenAI::Models::Responses::ResponseInputAudio::Format::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputAudio::Format::OrSymbol) - end - def format_=(_) - end + attr_accessor :format_ # The type of the input item. Always `input_audio`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An audio input to the model. sig do diff --git a/rbi/lib/openai/models/responses/response_input_file.rbi b/rbi/lib/openai/models/responses/response_input_file.rbi index cedf90ec..05c60269 100644 --- a/rbi/lib/openai/models/responses/response_input_file.rbi +++ b/rbi/lib/openai/models/responses/response_input_file.rbi @@ -6,39 +6,28 @@ module OpenAI class ResponseInputFile < OpenAI::BaseModel # The type of the input item. Always `input_file`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The content of the file to be sent to the model. sig { returns(T.nilable(String)) } - def file_data - end + attr_reader :file_data - sig { params(_: String).returns(String) } - def file_data=(_) - end + sig { params(file_data: String).void } + attr_writer :file_data # The ID of the file to be sent to the model. sig { returns(T.nilable(String)) } - def file_id - end + attr_reader :file_id - sig { params(_: String).returns(String) } - def file_id=(_) - end + sig { params(file_id: String).void } + attr_writer :file_id # The name of the file to be sent to the model. sig { returns(T.nilable(String)) } - def filename - end + attr_reader :filename - sig { params(_: String).returns(String) } - def filename=(_) - end + sig { params(filename: String).void } + attr_writer :filename # A file input to the model. sig do diff --git a/rbi/lib/openai/models/responses/response_input_image.rbi b/rbi/lib/openai/models/responses/response_input_image.rbi index 12174be2..677129df 100644 --- a/rbi/lib/openai/models/responses/response_input_image.rbi +++ b/rbi/lib/openai/models/responses/response_input_image.rbi @@ -7,43 +7,20 @@ module OpenAI # The detail level of the image to be sent to the model. One of `high`, `low`, or # `auto`. Defaults to `auto`. sig { returns(OpenAI::Models::Responses::ResponseInputImage::Detail::OrSymbol) } - def detail - end - - sig do - params(_: OpenAI::Models::Responses::ResponseInputImage::Detail::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputImage::Detail::OrSymbol) - end - def detail=(_) - end + attr_accessor :detail # The type of the input item. Always `input_image`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The ID of the file to be sent to the model. sig { returns(T.nilable(String)) } - def file_id - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def file_id=(_) - end + attr_accessor :file_id # The URL of the image to be sent to the model. A fully qualified URL or base64 # encoded image in a data URL. sig { returns(T.nilable(String)) } - def image_url - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def image_url=(_) - end + attr_accessor :image_url # An image input to the model. Learn about # [image inputs](https://platform.openai.com/docs/guides/vision). diff --git a/rbi/lib/openai/models/responses/response_input_item.rbi b/rbi/lib/openai/models/responses/response_input_item.rbi index 74e9e516..9c3341e5 100644 --- a/rbi/lib/openai/models/responses/response_input_item.rbi +++ b/rbi/lib/openai/models/responses/response_input_item.rbi @@ -44,68 +44,26 @@ module OpenAI ] ) end - def content - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputText, - OpenAI::Models::Responses::ResponseInputImage, - OpenAI::Models::Responses::ResponseInputFile - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputText, - OpenAI::Models::Responses::ResponseInputImage, - OpenAI::Models::Responses::ResponseInputFile - ) - ] - ) - end - def content=(_) - end + attr_accessor :content # The role of the message input. One of `user`, `system`, or `developer`. sig { returns(OpenAI::Models::Responses::ResponseInputItem::Message::Role::OrSymbol) } - def role - end - - sig do - params(_: OpenAI::Models::Responses::ResponseInputItem::Message::Role::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputItem::Message::Role::OrSymbol) - end - def role=(_) - end + attr_accessor :role # The status of item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseInputItem::Message::Status::OrSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseInputItem::Message::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputItem::Message::Status::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseInputItem::Message::Status::OrSymbol).void } + attr_writer :status # The type of the message input. Always set to `message`. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseInputItem::Message::Type::OrSymbol)) } - def type - end + attr_reader :type - sig do - params(_: OpenAI::Models::Responses::ResponseInputItem::Message::Type::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputItem::Message::Type::OrSymbol) - end - def type=(_) - end + sig { params(type: OpenAI::Models::Responses::ResponseInputItem::Message::Type::OrSymbol).void } + attr_writer :type # A message input to the model with a role indicating instruction following # hierarchy. Instructions given with the `developer` or `system` role take @@ -215,44 +173,30 @@ module OpenAI class ComputerCallOutput < OpenAI::BaseModel # The ID of the computer tool call that produced the output. sig { returns(String) } - def call_id - end - - sig { params(_: String).returns(String) } - def call_id=(_) - end + attr_accessor :call_id # A computer screenshot image used with the computer use tool. sig { returns(OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot) } - def output - end + attr_reader :output sig do params( - _: T.any(OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot, OpenAI::Util::AnyHash) + output: T.any(OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot, OpenAI::Util::AnyHash) ) - .returns(T.any(OpenAI::Models::Responses::ResponseComputerToolCallOutputScreenshot, OpenAI::Util::AnyHash)) - end - def output=(_) + .void end + attr_writer :output # The type of the computer tool call output. Always `computer_call_output`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The ID of the computer tool call output. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id # The safety checks reported by the API that have been acknowledged by the # developer. @@ -263,42 +207,28 @@ module OpenAI ) ) end - def acknowledged_safety_checks - end + attr_reader :acknowledged_safety_checks sig do params( - _: T::Array[ + acknowledged_safety_checks: T::Array[ T.any( OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::AcknowledgedSafetyCheck, OpenAI::Util::AnyHash ) ] ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::AcknowledgedSafetyCheck, - OpenAI::Util::AnyHash - ) - ] - ) - end - def acknowledged_safety_checks=(_) + .void end + attr_writer :acknowledged_safety_checks # The status of the message input. One of `in_progress`, `completed`, or # `incomplete`. Populated when input items are returned via API. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::Status::OrSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::Status::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput::Status::OrSymbol).void } + attr_writer :status # The output of a computer tool call. sig do @@ -339,30 +269,15 @@ module OpenAI class AcknowledgedSafetyCheck < OpenAI::BaseModel # The ID of the pending safety check. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The type of the pending safety check. sig { returns(String) } - def code - end - - sig { params(_: String).returns(String) } - def code=(_) - end + attr_accessor :code # Details about the pending safety check. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # A pending safety check for the computer call. sig { params(id: String, code: String, message: String).returns(T.attached_class) } @@ -408,53 +323,31 @@ module OpenAI class FunctionCallOutput < OpenAI::BaseModel # The unique ID of the function tool call generated by the model. sig { returns(String) } - def call_id - end - - sig { params(_: String).returns(String) } - def call_id=(_) - end + attr_accessor :call_id # A JSON string of the output of the function tool call. sig { returns(String) } - def output - end - - sig { params(_: String).returns(String) } - def output=(_) - end + attr_accessor :output # The type of the function tool call output. Always `function_call_output`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The unique ID of the function tool call output. Populated when this item is # returned via API. sig { returns(T.nilable(String)) } - def id - end + attr_reader :id - sig { params(_: String).returns(String) } - def id=(_) - end + sig { params(id: String).void } + attr_writer :id # The status of the item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput::Status::OrSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput::Status::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput::Status::OrSymbol).void } + attr_writer :status # The output of a function tool call. sig do @@ -519,21 +412,11 @@ module OpenAI class ItemReference < OpenAI::BaseModel # The ID of the item to reference. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The type of item to reference. Always `item_reference`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An internal identifier for an item to reference. sig { params(id: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_input_message_item.rbi b/rbi/lib/openai/models/responses/response_input_message_item.rbi index e6579bda..18f699d6 100644 --- a/rbi/lib/openai/models/responses/response_input_message_item.rbi +++ b/rbi/lib/openai/models/responses/response_input_message_item.rbi @@ -6,12 +6,7 @@ module OpenAI class ResponseInputMessageItem < OpenAI::BaseModel # The unique ID of the message input. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # A list of one or many input items to the model, containing different content # types. @@ -26,68 +21,26 @@ module OpenAI ] ) end - def content - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputText, - OpenAI::Models::Responses::ResponseInputImage, - OpenAI::Models::Responses::ResponseInputFile - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputText, - OpenAI::Models::Responses::ResponseInputImage, - OpenAI::Models::Responses::ResponseInputFile - ) - ] - ) - end - def content=(_) - end + attr_accessor :content # The role of the message input. One of `user`, `system`, or `developer`. sig { returns(OpenAI::Models::Responses::ResponseInputMessageItem::Role::TaggedSymbol) } - def role - end - - sig do - params(_: OpenAI::Models::Responses::ResponseInputMessageItem::Role::TaggedSymbol) - .returns(OpenAI::Models::Responses::ResponseInputMessageItem::Role::TaggedSymbol) - end - def role=(_) - end + attr_accessor :role # The status of item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseInputMessageItem::Status::TaggedSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseInputMessageItem::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputMessageItem::Status::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseInputMessageItem::Status::OrSymbol).void } + attr_writer :status # The type of the message input. Always set to `message`. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseInputMessageItem::Type::TaggedSymbol)) } - def type - end + attr_reader :type - sig do - params(_: OpenAI::Models::Responses::ResponseInputMessageItem::Type::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseInputMessageItem::Type::OrSymbol) - end - def type=(_) - end + sig { params(type: OpenAI::Models::Responses::ResponseInputMessageItem::Type::OrSymbol).void } + attr_writer :type sig do params( diff --git a/rbi/lib/openai/models/responses/response_input_text.rbi b/rbi/lib/openai/models/responses/response_input_text.rbi index 16fc4040..5c0838ec 100644 --- a/rbi/lib/openai/models/responses/response_input_text.rbi +++ b/rbi/lib/openai/models/responses/response_input_text.rbi @@ -6,21 +6,11 @@ module OpenAI class ResponseInputText < OpenAI::BaseModel # The text input to the model. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # The type of the input item. Always `input_text`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A text input to the model. sig { params(text: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_item_list.rbi b/rbi/lib/openai/models/responses/response_item_list.rbi index afdd9b6d..a7e4d918 100644 --- a/rbi/lib/openai/models/responses/response_item_list.rbi +++ b/rbi/lib/openai/models/responses/response_item_list.rbi @@ -21,77 +21,23 @@ module OpenAI ] ) end - def data - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputMessageItem, - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseComputerToolCallOutputItem, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseFunctionToolCallItem, - OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseInputMessageItem, - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseComputerToolCallOutputItem, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseFunctionToolCallItem, - OpenAI::Models::Responses::ResponseFunctionToolCallOutputItem - ) - ] - ) - end - def data=(_) - end + attr_accessor :data # The ID of the first item in the list. sig { returns(String) } - def first_id - end - - sig { params(_: String).returns(String) } - def first_id=(_) - end + attr_accessor :first_id # Whether there are more items available. sig { returns(T::Boolean) } - def has_more - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def has_more=(_) - end + attr_accessor :has_more # The ID of the last item in the list. sig { returns(String) } - def last_id - end - - sig { params(_: String).returns(String) } - def last_id=(_) - end + attr_accessor :last_id # The type of object returned, must be `list`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # A list of Response items. sig do diff --git a/rbi/lib/openai/models/responses/response_output_audio.rbi b/rbi/lib/openai/models/responses/response_output_audio.rbi index 162e5138..c5a26f54 100644 --- a/rbi/lib/openai/models/responses/response_output_audio.rbi +++ b/rbi/lib/openai/models/responses/response_output_audio.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseOutputAudio < OpenAI::BaseModel # Base64-encoded audio data from the model. sig { returns(String) } - def data - end - - sig { params(_: String).returns(String) } - def data=(_) - end + attr_accessor :data # The transcript of the audio data from the model. sig { returns(String) } - def transcript - end - - sig { params(_: String).returns(String) } - def transcript=(_) - end + attr_accessor :transcript # The type of the output audio. Always `output_audio`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An audio output from the model. sig { params(data: String, transcript: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_output_item_added_event.rbi b/rbi/lib/openai/models/responses/response_output_item_added_event.rbi index 42d8f23b..648d48d9 100644 --- a/rbi/lib/openai/models/responses/response_output_item_added_event.rbi +++ b/rbi/lib/openai/models/responses/response_output_item_added_event.rbi @@ -17,51 +17,15 @@ module OpenAI ) ) end - def item - end - - sig do - params( - _: T.any( - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseFunctionToolCall, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseReasoningItem - ) - ) - .returns( - T.any( - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseFunctionToolCall, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseReasoningItem - ) - ) - end - def item=(_) - end + attr_accessor :item # The index of the output item that was added. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.output_item.added`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a new output item is added. sig do diff --git a/rbi/lib/openai/models/responses/response_output_item_done_event.rbi b/rbi/lib/openai/models/responses/response_output_item_done_event.rbi index 0e58ab9d..1d8ebd83 100644 --- a/rbi/lib/openai/models/responses/response_output_item_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_output_item_done_event.rbi @@ -17,51 +17,15 @@ module OpenAI ) ) end - def item - end - - sig do - params( - _: T.any( - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseFunctionToolCall, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseReasoningItem - ) - ) - .returns( - T.any( - OpenAI::Models::Responses::ResponseOutputMessage, - OpenAI::Models::Responses::ResponseFileSearchToolCall, - OpenAI::Models::Responses::ResponseFunctionToolCall, - OpenAI::Models::Responses::ResponseFunctionWebSearch, - OpenAI::Models::Responses::ResponseComputerToolCall, - OpenAI::Models::Responses::ResponseReasoningItem - ) - ) - end - def item=(_) - end + attr_accessor :item # The index of the output item that was marked done. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.output_item.done`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when an output item is marked done. sig do diff --git a/rbi/lib/openai/models/responses/response_output_message.rbi b/rbi/lib/openai/models/responses/response_output_message.rbi index 9b6bf634..dabf3215 100644 --- a/rbi/lib/openai/models/responses/response_output_message.rbi +++ b/rbi/lib/openai/models/responses/response_output_message.rbi @@ -6,12 +6,7 @@ module OpenAI class ResponseOutputMessage < OpenAI::BaseModel # The unique ID of the output message. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The content of the output message. sig do @@ -19,50 +14,20 @@ module OpenAI T::Array[T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal)] ) end - def content - end - - sig do - params( - _: T::Array[T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal)] - ) - .returns( - T::Array[T.any(OpenAI::Models::Responses::ResponseOutputText, OpenAI::Models::Responses::ResponseOutputRefusal)] - ) - end - def content=(_) - end + attr_accessor :content # The role of the output message. Always `assistant`. sig { returns(Symbol) } - def role - end - - sig { params(_: Symbol).returns(Symbol) } - def role=(_) - end + attr_accessor :role # The status of the message input. One of `in_progress`, `completed`, or # `incomplete`. Populated when input items are returned via API. sig { returns(OpenAI::Models::Responses::ResponseOutputMessage::Status::OrSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Responses::ResponseOutputMessage::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseOutputMessage::Status::OrSymbol) - end - def status=(_) - end + attr_accessor :status # The type of the output message. Always `message`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # An output message from the model. sig do diff --git a/rbi/lib/openai/models/responses/response_output_refusal.rbi b/rbi/lib/openai/models/responses/response_output_refusal.rbi index 1db3c101..5e416cf9 100644 --- a/rbi/lib/openai/models/responses/response_output_refusal.rbi +++ b/rbi/lib/openai/models/responses/response_output_refusal.rbi @@ -6,21 +6,11 @@ module OpenAI class ResponseOutputRefusal < OpenAI::BaseModel # The refusal explanationfrom the model. sig { returns(String) } - def refusal - end - - sig { params(_: String).returns(String) } - def refusal=(_) - end + attr_accessor :refusal # The type of the refusal. Always `refusal`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A refusal from the model. sig { params(refusal: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_output_text.rbi b/rbi/lib/openai/models/responses/response_output_text.rbi index 5c365bc5..36a04fa3 100644 --- a/rbi/lib/openai/models/responses/response_output_text.rbi +++ b/rbi/lib/openai/models/responses/response_output_text.rbi @@ -16,49 +16,15 @@ module OpenAI ] ) end - def annotations - end - - sig do - params( - _: T::Array[ - T.any( - OpenAI::Models::Responses::ResponseOutputText::Annotation::FileCitation, - OpenAI::Models::Responses::ResponseOutputText::Annotation::URLCitation, - OpenAI::Models::Responses::ResponseOutputText::Annotation::FilePath - ) - ] - ) - .returns( - T::Array[ - T.any( - OpenAI::Models::Responses::ResponseOutputText::Annotation::FileCitation, - OpenAI::Models::Responses::ResponseOutputText::Annotation::URLCitation, - OpenAI::Models::Responses::ResponseOutputText::Annotation::FilePath - ) - ] - ) - end - def annotations=(_) - end + attr_accessor :annotations # The text output from the model. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # The type of the output text. Always `output_text`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A text output from the model. sig do @@ -116,30 +82,15 @@ module OpenAI class FileCitation < OpenAI::BaseModel # The ID of the file. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # The index of the file in the list of files. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The type of the file citation. Always `file_citation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A citation to a file. sig { params(file_id: String, index: Integer, type: Symbol).returns(T.attached_class) } @@ -154,48 +105,23 @@ module OpenAI class URLCitation < OpenAI::BaseModel # The index of the last character of the URL citation in the message. sig { returns(Integer) } - def end_index - end - - sig { params(_: Integer).returns(Integer) } - def end_index=(_) - end + attr_accessor :end_index # The index of the first character of the URL citation in the message. sig { returns(Integer) } - def start_index - end - - sig { params(_: Integer).returns(Integer) } - def start_index=(_) - end + attr_accessor :start_index # The title of the web resource. sig { returns(String) } - def title - end - - sig { params(_: String).returns(String) } - def title=(_) - end + attr_accessor :title # The type of the URL citation. Always `url_citation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The URL of the web resource. sig { returns(String) } - def url - end - - sig { params(_: String).returns(String) } - def url=(_) - end + attr_accessor :url # A citation for a web resource used to generate a model response. sig do @@ -223,30 +149,15 @@ module OpenAI class FilePath < OpenAI::BaseModel # The ID of the file. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # The index of the file in the list of files. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The type of the file path. Always `file_path`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A path to a file. sig { params(file_id: String, index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_reasoning_item.rbi b/rbi/lib/openai/models/responses/response_reasoning_item.rbi index 12f95019..7c7b4827 100644 --- a/rbi/lib/openai/models/responses/response_reasoning_item.rbi +++ b/rbi/lib/openai/models/responses/response_reasoning_item.rbi @@ -6,46 +6,23 @@ module OpenAI class ResponseReasoningItem < OpenAI::BaseModel # The unique identifier of the reasoning content. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # Reasoning text contents. sig { returns(T::Array[OpenAI::Models::Responses::ResponseReasoningItem::Summary]) } - def summary - end - - sig do - params(_: T::Array[OpenAI::Models::Responses::ResponseReasoningItem::Summary]) - .returns(T::Array[OpenAI::Models::Responses::ResponseReasoningItem::Summary]) - end - def summary=(_) - end + attr_accessor :summary # The type of the object. Always `reasoning`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The status of the item. One of `in_progress`, `completed`, or `incomplete`. # Populated when items are returned via API. sig { returns(T.nilable(OpenAI::Models::Responses::ResponseReasoningItem::Status::OrSymbol)) } - def status - end + attr_reader :status - sig do - params(_: OpenAI::Models::Responses::ResponseReasoningItem::Status::OrSymbol) - .returns(OpenAI::Models::Responses::ResponseReasoningItem::Status::OrSymbol) - end - def status=(_) - end + sig { params(status: OpenAI::Models::Responses::ResponseReasoningItem::Status::OrSymbol).void } + attr_writer :status # A description of the chain of thought used by a reasoning model while generating # a response. @@ -78,21 +55,11 @@ module OpenAI class Summary < OpenAI::BaseModel # A short summary of the reasoning used by the model when generating the response. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # The type of the object. Always `summary_text`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig { params(text: String, type: Symbol).returns(T.attached_class) } def self.new(text:, type: :summary_text) diff --git a/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi b/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi index f4a53f02..cbbd66ed 100644 --- a/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_refusal_delta_event.rbi @@ -6,48 +6,23 @@ module OpenAI class ResponseRefusalDeltaEvent < OpenAI::BaseModel # The index of the content part that the refusal text is added to. sig { returns(Integer) } - def content_index - end - - sig { params(_: Integer).returns(Integer) } - def content_index=(_) - end + attr_accessor :content_index # The refusal text that is added. sig { returns(String) } - def delta - end - - sig { params(_: String).returns(String) } - def delta=(_) - end + attr_accessor :delta # The ID of the output item that the refusal text is added to. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the refusal text is added to. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.refusal.delta`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when there is a partial refusal text. sig do diff --git a/rbi/lib/openai/models/responses/response_refusal_done_event.rbi b/rbi/lib/openai/models/responses/response_refusal_done_event.rbi index 1e4bf80b..1f24f6df 100644 --- a/rbi/lib/openai/models/responses/response_refusal_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_refusal_done_event.rbi @@ -6,48 +6,23 @@ module OpenAI class ResponseRefusalDoneEvent < OpenAI::BaseModel # The index of the content part that the refusal text is finalized. sig { returns(Integer) } - def content_index - end - - sig { params(_: Integer).returns(Integer) } - def content_index=(_) - end + attr_accessor :content_index # The ID of the output item that the refusal text is finalized. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the refusal text is finalized. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The refusal text that is finalized. sig { returns(String) } - def refusal - end - - sig { params(_: String).returns(String) } - def refusal=(_) - end + attr_accessor :refusal # The type of the event. Always `response.refusal.done`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when refusal text is finalized. sig do diff --git a/rbi/lib/openai/models/responses/response_retrieve_params.rbi b/rbi/lib/openai/models/responses/response_retrieve_params.rbi index 91c155d7..da5deb7b 100644 --- a/rbi/lib/openai/models/responses/response_retrieve_params.rbi +++ b/rbi/lib/openai/models/responses/response_retrieve_params.rbi @@ -10,15 +10,10 @@ module OpenAI # Additional fields to include in the response. See the `include` parameter for # Response creation above for more information. sig { returns(T.nilable(T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol])) } - def include - end + attr_reader :include - sig do - params(_: T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol]) - .returns(T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol]) - end - def include=(_) - end + sig { params(include: T::Array[OpenAI::Models::Responses::ResponseIncludable::OrSymbol]).void } + attr_writer :include sig do params( diff --git a/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi b/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi index 2be76360..55d9384e 100644 --- a/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_text_annotation_delta_event.rbi @@ -14,72 +14,27 @@ module OpenAI ) ) end - def annotation - end - - sig do - params( - _: T.any( - OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FileCitation, - OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::URLCitation, - OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FilePath - ) - ) - .returns( - T.any( - OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FileCitation, - OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::URLCitation, - OpenAI::Models::Responses::ResponseTextAnnotationDeltaEvent::Annotation::FilePath - ) - ) - end - def annotation=(_) - end + attr_accessor :annotation # The index of the annotation that was added. sig { returns(Integer) } - def annotation_index - end - - sig { params(_: Integer).returns(Integer) } - def annotation_index=(_) - end + attr_accessor :annotation_index # The index of the content part that the text annotation was added to. sig { returns(Integer) } - def content_index - end - - sig { params(_: Integer).returns(Integer) } - def content_index=(_) - end + attr_accessor :content_index # The ID of the output item that the text annotation was added to. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the text annotation was added to. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.output_text.annotation.added`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a text annotation is added. sig do @@ -146,30 +101,15 @@ module OpenAI class FileCitation < OpenAI::BaseModel # The ID of the file. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # The index of the file in the list of files. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The type of the file citation. Always `file_citation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A citation to a file. sig { params(file_id: String, index: Integer, type: Symbol).returns(T.attached_class) } @@ -184,48 +124,23 @@ module OpenAI class URLCitation < OpenAI::BaseModel # The index of the last character of the URL citation in the message. sig { returns(Integer) } - def end_index - end - - sig { params(_: Integer).returns(Integer) } - def end_index=(_) - end + attr_accessor :end_index # The index of the first character of the URL citation in the message. sig { returns(Integer) } - def start_index - end - - sig { params(_: Integer).returns(Integer) } - def start_index=(_) - end + attr_accessor :start_index # The title of the web resource. sig { returns(String) } - def title - end - - sig { params(_: String).returns(String) } - def title=(_) - end + attr_accessor :title # The type of the URL citation. Always `url_citation`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # The URL of the web resource. sig { returns(String) } - def url - end - - sig { params(_: String).returns(String) } - def url=(_) - end + attr_accessor :url # A citation for a web resource used to generate a model response. sig do @@ -253,30 +168,15 @@ module OpenAI class FilePath < OpenAI::BaseModel # The ID of the file. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # The index of the file in the list of files. sig { returns(Integer) } - def index - end - - sig { params(_: Integer).returns(Integer) } - def index=(_) - end + attr_accessor :index # The type of the file path. Always `file_path`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # A path to a file. sig { params(file_id: String, index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_text_config.rbi b/rbi/lib/openai/models/responses/response_text_config.rbi index a04a62b1..240a7e92 100644 --- a/rbi/lib/openai/models/responses/response_text_config.rbi +++ b/rbi/lib/openai/models/responses/response_text_config.rbi @@ -28,29 +28,20 @@ module OpenAI ) ) end - def format_ - end + attr_reader :format_ sig do params( - _: T.any( + format_: T.any( OpenAI::Models::ResponseFormatText, OpenAI::Util::AnyHash, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig, OpenAI::Models::ResponseFormatJSONObject ) ) - .returns( - T.any( - OpenAI::Models::ResponseFormatText, - OpenAI::Util::AnyHash, - OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig, - OpenAI::Models::ResponseFormatJSONObject - ) - ) - end - def format_=(_) + .void end + attr_writer :format_ # Configuration options for a text response from the model. Can be plain text or # structured JSON data. Learn more: diff --git a/rbi/lib/openai/models/responses/response_text_delta_event.rbi b/rbi/lib/openai/models/responses/response_text_delta_event.rbi index 50307018..efb4c979 100644 --- a/rbi/lib/openai/models/responses/response_text_delta_event.rbi +++ b/rbi/lib/openai/models/responses/response_text_delta_event.rbi @@ -6,48 +6,23 @@ module OpenAI class ResponseTextDeltaEvent < OpenAI::BaseModel # The index of the content part that the text delta was added to. sig { returns(Integer) } - def content_index - end - - sig { params(_: Integer).returns(Integer) } - def content_index=(_) - end + attr_accessor :content_index # The text delta that was added. sig { returns(String) } - def delta - end - - sig { params(_: String).returns(String) } - def delta=(_) - end + attr_accessor :delta # The ID of the output item that the text delta was added to. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the text delta was added to. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.output_text.delta`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when there is an additional text delta. sig do diff --git a/rbi/lib/openai/models/responses/response_text_done_event.rbi b/rbi/lib/openai/models/responses/response_text_done_event.rbi index 56e6ddd7..b8e7bf9a 100644 --- a/rbi/lib/openai/models/responses/response_text_done_event.rbi +++ b/rbi/lib/openai/models/responses/response_text_done_event.rbi @@ -6,48 +6,23 @@ module OpenAI class ResponseTextDoneEvent < OpenAI::BaseModel # The index of the content part that the text content is finalized. sig { returns(Integer) } - def content_index - end - - sig { params(_: Integer).returns(Integer) } - def content_index=(_) - end + attr_accessor :content_index # The ID of the output item that the text content is finalized. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the text content is finalized. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The text content that is finalized. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # The type of the event. Always `response.output_text.done`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when text content is finalized. sig do diff --git a/rbi/lib/openai/models/responses/response_usage.rbi b/rbi/lib/openai/models/responses/response_usage.rbi index 10397181..b3158710 100644 --- a/rbi/lib/openai/models/responses/response_usage.rbi +++ b/rbi/lib/openai/models/responses/response_usage.rbi @@ -6,54 +6,39 @@ module OpenAI class ResponseUsage < OpenAI::BaseModel # The number of input tokens. sig { returns(Integer) } - def input_tokens - end - - sig { params(_: Integer).returns(Integer) } - def input_tokens=(_) - end + attr_accessor :input_tokens # A detailed breakdown of the input tokens. sig { returns(OpenAI::Models::Responses::ResponseUsage::InputTokensDetails) } - def input_tokens_details - end + attr_reader :input_tokens_details sig do - params(_: T.any(OpenAI::Models::Responses::ResponseUsage::InputTokensDetails, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::ResponseUsage::InputTokensDetails, OpenAI::Util::AnyHash)) - end - def input_tokens_details=(_) + params( + input_tokens_details: T.any(OpenAI::Models::Responses::ResponseUsage::InputTokensDetails, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :input_tokens_details # The number of output tokens. sig { returns(Integer) } - def output_tokens - end - - sig { params(_: Integer).returns(Integer) } - def output_tokens=(_) - end + attr_accessor :output_tokens # A detailed breakdown of the output tokens. sig { returns(OpenAI::Models::Responses::ResponseUsage::OutputTokensDetails) } - def output_tokens_details - end + attr_reader :output_tokens_details sig do - params(_: T.any(OpenAI::Models::Responses::ResponseUsage::OutputTokensDetails, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::Responses::ResponseUsage::OutputTokensDetails, OpenAI::Util::AnyHash)) - end - def output_tokens_details=(_) + params( + output_tokens_details: T.any(OpenAI::Models::Responses::ResponseUsage::OutputTokensDetails, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :output_tokens_details # The total number of tokens used. sig { returns(Integer) } - def total_tokens - end - - sig { params(_: Integer).returns(Integer) } - def total_tokens=(_) - end + attr_accessor :total_tokens # Represents token usage details including input tokens, output tokens, a # breakdown of output tokens, and the total tokens used. @@ -89,12 +74,7 @@ module OpenAI # The number of tokens that were retrieved from the cache. # [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). sig { returns(Integer) } - def cached_tokens - end - - sig { params(_: Integer).returns(Integer) } - def cached_tokens=(_) - end + attr_accessor :cached_tokens # A detailed breakdown of the input tokens. sig { params(cached_tokens: Integer).returns(T.attached_class) } @@ -109,12 +89,7 @@ module OpenAI class OutputTokensDetails < OpenAI::BaseModel # The number of reasoning tokens. sig { returns(Integer) } - def reasoning_tokens - end - - sig { params(_: Integer).returns(Integer) } - def reasoning_tokens=(_) - end + attr_accessor :reasoning_tokens # A detailed breakdown of the output tokens. sig { params(reasoning_tokens: Integer).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi b/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi index 1348fded..b02a5b1f 100644 --- a/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi +++ b/rbi/lib/openai/models/responses/response_web_search_call_completed_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseWebSearchCallCompletedEvent < OpenAI::BaseModel # Unique ID for the output item associated with the web search call. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the web search call is associated with. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.web_search_call.completed`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a web search call is completed. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi b/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi index 891725d6..11aa3340 100644 --- a/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi +++ b/rbi/lib/openai/models/responses/response_web_search_call_in_progress_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseWebSearchCallInProgressEvent < OpenAI::BaseModel # Unique ID for the output item associated with the web search call. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the web search call is associated with. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.web_search_call.in_progress`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a web search call is initiated. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi b/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi index a2f0a421..c97724d2 100644 --- a/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi +++ b/rbi/lib/openai/models/responses/response_web_search_call_searching_event.rbi @@ -6,30 +6,15 @@ module OpenAI class ResponseWebSearchCallSearchingEvent < OpenAI::BaseModel # Unique ID for the output item associated with the web search call. sig { returns(String) } - def item_id - end - - sig { params(_: String).returns(String) } - def item_id=(_) - end + attr_accessor :item_id # The index of the output item that the web search call is associated with. sig { returns(Integer) } - def output_index - end - - sig { params(_: Integer).returns(Integer) } - def output_index=(_) - end + attr_accessor :output_index # The type of the event. Always `response.web_search_call.searching`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Emitted when a web search call is executing. sig { params(item_id: String, output_index: Integer, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/tool_choice_function.rbi b/rbi/lib/openai/models/responses/tool_choice_function.rbi index a8afd2d4..29aa1b6c 100644 --- a/rbi/lib/openai/models/responses/tool_choice_function.rbi +++ b/rbi/lib/openai/models/responses/tool_choice_function.rbi @@ -6,21 +6,11 @@ module OpenAI class ToolChoiceFunction < OpenAI::BaseModel # The name of the function to call. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # For function calling, the type is always `function`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Use this option to force the model to call a specific function. sig { params(name: String, type: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/responses/tool_choice_types.rbi b/rbi/lib/openai/models/responses/tool_choice_types.rbi index efede45b..3332abb3 100644 --- a/rbi/lib/openai/models/responses/tool_choice_types.rbi +++ b/rbi/lib/openai/models/responses/tool_choice_types.rbi @@ -13,15 +13,7 @@ module OpenAI # - `web_search_preview` # - `computer_use_preview` sig { returns(OpenAI::Models::Responses::ToolChoiceTypes::Type::OrSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::Responses::ToolChoiceTypes::Type::OrSymbol) - .returns(OpenAI::Models::Responses::ToolChoiceTypes::Type::OrSymbol) - end - def type=(_) - end + attr_accessor :type # Indicates that the model should use a built-in tool to generate a response. # [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). diff --git a/rbi/lib/openai/models/responses/web_search_tool.rbi b/rbi/lib/openai/models/responses/web_search_tool.rbi index ae1af675..c100a08a 100644 --- a/rbi/lib/openai/models/responses/web_search_tool.rbi +++ b/rbi/lib/openai/models/responses/web_search_tool.rbi @@ -9,39 +9,26 @@ module OpenAI # - `web_search_preview` # - `web_search_preview_2025_03_11` sig { returns(OpenAI::Models::Responses::WebSearchTool::Type::OrSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::Responses::WebSearchTool::Type::OrSymbol) - .returns(OpenAI::Models::Responses::WebSearchTool::Type::OrSymbol) - end - def type=(_) - end + attr_accessor :type # High level guidance for the amount of context window space to use for the # search. One of `low`, `medium`, or `high`. `medium` is the default. sig { returns(T.nilable(OpenAI::Models::Responses::WebSearchTool::SearchContextSize::OrSymbol)) } - def search_context_size - end + attr_reader :search_context_size - sig do - params(_: OpenAI::Models::Responses::WebSearchTool::SearchContextSize::OrSymbol) - .returns(OpenAI::Models::Responses::WebSearchTool::SearchContextSize::OrSymbol) - end - def search_context_size=(_) - end + sig { params(search_context_size: OpenAI::Models::Responses::WebSearchTool::SearchContextSize::OrSymbol).void } + attr_writer :search_context_size sig { returns(T.nilable(OpenAI::Models::Responses::WebSearchTool::UserLocation)) } - def user_location - end + attr_reader :user_location sig do - params(_: T.nilable(T.any(OpenAI::Models::Responses::WebSearchTool::UserLocation, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::Responses::WebSearchTool::UserLocation, OpenAI::Util::AnyHash))) - end - def user_location=(_) + params( + user_location: T.nilable(T.any(OpenAI::Models::Responses::WebSearchTool::UserLocation, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :user_location # This tool searches the web for relevant results to use in a response. Learn more # about the @@ -116,50 +103,37 @@ module OpenAI class UserLocation < OpenAI::BaseModel # The type of location approximation. Always `approximate`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Free text input for the city of the user, e.g. `San Francisco`. sig { returns(T.nilable(String)) } - def city - end + attr_reader :city - sig { params(_: String).returns(String) } - def city=(_) - end + sig { params(city: String).void } + attr_writer :city # The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of # the user, e.g. `US`. sig { returns(T.nilable(String)) } - def country - end + attr_reader :country - sig { params(_: String).returns(String) } - def country=(_) - end + sig { params(country: String).void } + attr_writer :country # Free text input for the region of the user, e.g. `California`. sig { returns(T.nilable(String)) } - def region - end + attr_reader :region - sig { params(_: String).returns(String) } - def region=(_) - end + sig { params(region: String).void } + attr_writer :region # The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the # user, e.g. `America/Los_Angeles`. sig { returns(T.nilable(String)) } - def timezone - end + attr_reader :timezone - sig { params(_: String).returns(String) } - def timezone=(_) - end + sig { params(timezone: String).void } + attr_writer :timezone sig do params(city: String, country: String, region: String, timezone: String, type: Symbol) diff --git a/rbi/lib/openai/models/static_file_chunking_strategy.rbi b/rbi/lib/openai/models/static_file_chunking_strategy.rbi index 1d8d219c..bb5abe4d 100644 --- a/rbi/lib/openai/models/static_file_chunking_strategy.rbi +++ b/rbi/lib/openai/models/static_file_chunking_strategy.rbi @@ -7,22 +7,12 @@ module OpenAI # # Note that the overlap must not exceed half of `max_chunk_size_tokens`. sig { returns(Integer) } - def chunk_overlap_tokens - end - - sig { params(_: Integer).returns(Integer) } - def chunk_overlap_tokens=(_) - end + attr_accessor :chunk_overlap_tokens # The maximum number of tokens in each chunk. The default value is `800`. The # minimum value is `100` and the maximum value is `4096`. sig { returns(Integer) } - def max_chunk_size_tokens - end - - sig { params(_: Integer).returns(Integer) } - def max_chunk_size_tokens=(_) - end + attr_accessor :max_chunk_size_tokens sig { params(chunk_overlap_tokens: Integer, max_chunk_size_tokens: Integer).returns(T.attached_class) } def self.new(chunk_overlap_tokens:, max_chunk_size_tokens:) diff --git a/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi b/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi index deafa473..eac14e48 100644 --- a/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi +++ b/rbi/lib/openai/models/static_file_chunking_strategy_object.rbi @@ -4,24 +4,14 @@ module OpenAI module Models class StaticFileChunkingStrategyObject < OpenAI::BaseModel sig { returns(OpenAI::Models::StaticFileChunkingStrategy) } - def static - end + attr_reader :static - sig do - params(_: T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Util::AnyHash)) - end - def static=(_) - end + sig { params(static: T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Util::AnyHash)).void } + attr_writer :static # Always `static`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type sig do params(static: T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Util::AnyHash), type: Symbol) diff --git a/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi b/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi index 4c4a6100..5387db39 100644 --- a/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi +++ b/rbi/lib/openai/models/static_file_chunking_strategy_object_param.rbi @@ -4,24 +4,14 @@ module OpenAI module Models class StaticFileChunkingStrategyObjectParam < OpenAI::BaseModel sig { returns(OpenAI::Models::StaticFileChunkingStrategy) } - def static - end + attr_reader :static - sig do - params(_: T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Util::AnyHash)) - end - def static=(_) - end + sig { params(static: T.any(OpenAI::Models::StaticFileChunkingStrategy, OpenAI::Util::AnyHash)).void } + attr_writer :static # Always `static`. sig { returns(Symbol) } - def type - end - - sig { params(_: Symbol).returns(Symbol) } - def type=(_) - end + attr_accessor :type # Customize your own chunking strategy by setting chunk size and chunk overlap. sig do diff --git a/rbi/lib/openai/models/upload.rbi b/rbi/lib/openai/models/upload.rbi index 949a6347..49ff6e17 100644 --- a/rbi/lib/openai/models/upload.rbi +++ b/rbi/lib/openai/models/upload.rbi @@ -5,92 +5,44 @@ module OpenAI class Upload < OpenAI::BaseModel # The Upload unique identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The intended number of bytes to be uploaded. sig { returns(Integer) } - def bytes - end - - sig { params(_: Integer).returns(Integer) } - def bytes=(_) - end + attr_accessor :bytes # The Unix timestamp (in seconds) for when the Upload was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The Unix timestamp (in seconds) for when the Upload will expire. sig { returns(Integer) } - def expires_at - end - - sig { params(_: Integer).returns(Integer) } - def expires_at=(_) - end + attr_accessor :expires_at # The name of the file to be uploaded. sig { returns(String) } - def filename - end - - sig { params(_: String).returns(String) } - def filename=(_) - end + attr_accessor :filename # The object type, which is always "upload". sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The intended purpose of the file. # [Please refer here](https://platform.openai.com/docs/api-reference/files/object#files/object-purpose) # for acceptable values. sig { returns(String) } - def purpose - end - - sig { params(_: String).returns(String) } - def purpose=(_) - end + attr_accessor :purpose # The status of the Upload. sig { returns(OpenAI::Models::Upload::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::Upload::Status::TaggedSymbol) - .returns(OpenAI::Models::Upload::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The `File` object represents a document that has been uploaded to OpenAI. sig { returns(T.nilable(OpenAI::Models::FileObject)) } - def file - end + attr_reader :file - sig do - params(_: T.nilable(T.any(OpenAI::Models::FileObject, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::FileObject, OpenAI::Util::AnyHash))) - end - def file=(_) - end + sig { params(file: T.nilable(T.any(OpenAI::Models::FileObject, OpenAI::Util::AnyHash))).void } + attr_writer :file # The Upload object can accept byte chunks in the form of Parts. sig do diff --git a/rbi/lib/openai/models/upload_complete_params.rbi b/rbi/lib/openai/models/upload_complete_params.rbi index 4503bab7..676ce576 100644 --- a/rbi/lib/openai/models/upload_complete_params.rbi +++ b/rbi/lib/openai/models/upload_complete_params.rbi @@ -8,22 +8,15 @@ module OpenAI # The ordered list of Part IDs. sig { returns(T::Array[String]) } - def part_ids - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def part_ids=(_) - end + attr_accessor :part_ids # The optional md5 checksum for the file contents to verify if the bytes uploaded # matches what you expect. sig { returns(T.nilable(String)) } - def md5 - end + attr_reader :md5 - sig { params(_: String).returns(String) } - def md5=(_) - end + sig { params(md5: String).void } + attr_writer :md5 sig do params( diff --git a/rbi/lib/openai/models/upload_create_params.rbi b/rbi/lib/openai/models/upload_create_params.rbi index d6b9c299..9fdac8ce 100644 --- a/rbi/lib/openai/models/upload_create_params.rbi +++ b/rbi/lib/openai/models/upload_create_params.rbi @@ -8,45 +8,25 @@ module OpenAI # The number of bytes in the file you are uploading. sig { returns(Integer) } - def bytes - end - - sig { params(_: Integer).returns(Integer) } - def bytes=(_) - end + attr_accessor :bytes # The name of the file to upload. sig { returns(String) } - def filename - end - - sig { params(_: String).returns(String) } - def filename=(_) - end + attr_accessor :filename # The MIME type of the file. # # This must fall within the supported MIME types for your file purpose. See the # supported MIME types for assistants and vision. sig { returns(String) } - def mime_type - end - - sig { params(_: String).returns(String) } - def mime_type=(_) - end + attr_accessor :mime_type # The intended purpose of the uploaded file. # # See the # [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose). sig { returns(OpenAI::Models::FilePurpose::OrSymbol) } - def purpose - end - - sig { params(_: OpenAI::Models::FilePurpose::OrSymbol).returns(OpenAI::Models::FilePurpose::OrSymbol) } - def purpose=(_) - end + attr_accessor :purpose sig do params( diff --git a/rbi/lib/openai/models/uploads/part_create_params.rbi b/rbi/lib/openai/models/uploads/part_create_params.rbi index d52036fc..a73f5e78 100644 --- a/rbi/lib/openai/models/uploads/part_create_params.rbi +++ b/rbi/lib/openai/models/uploads/part_create_params.rbi @@ -9,12 +9,7 @@ module OpenAI # The chunk of bytes for this Part. sig { returns(T.any(IO, StringIO)) } - def data - end - - sig { params(_: T.any(IO, StringIO)).returns(T.any(IO, StringIO)) } - def data=(_) - end + attr_accessor :data sig do params( diff --git a/rbi/lib/openai/models/uploads/upload_part.rbi b/rbi/lib/openai/models/uploads/upload_part.rbi index 59ae7dda..43223349 100644 --- a/rbi/lib/openai/models/uploads/upload_part.rbi +++ b/rbi/lib/openai/models/uploads/upload_part.rbi @@ -6,39 +6,19 @@ module OpenAI class UploadPart < OpenAI::BaseModel # The upload Part unique identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the Part was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The object type, which is always `upload.part`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The ID of the Upload object that this Part was added to. sig { returns(String) } - def upload_id - end - - sig { params(_: String).returns(String) } - def upload_id=(_) - end + attr_accessor :upload_id # The upload Part represents a chunk of bytes we can add to an Upload object. sig do diff --git a/rbi/lib/openai/models/vector_store.rbi b/rbi/lib/openai/models/vector_store.rbi index a3dc0af1..aeb5522d 100644 --- a/rbi/lib/openai/models/vector_store.rbi +++ b/rbi/lib/openai/models/vector_store.rbi @@ -5,41 +5,21 @@ module OpenAI class VectorStore < OpenAI::BaseModel # The identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the vector store was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at sig { returns(OpenAI::Models::VectorStore::FileCounts) } - def file_counts - end + attr_reader :file_counts - sig do - params(_: T.any(OpenAI::Models::VectorStore::FileCounts, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::VectorStore::FileCounts, OpenAI::Util::AnyHash)) - end - def file_counts=(_) - end + sig { params(file_counts: T.any(OpenAI::Models::VectorStore::FileCounts, OpenAI::Util::AnyHash)).void } + attr_writer :file_counts # The Unix timestamp (in seconds) for when the vector store was last active. sig { returns(T.nilable(Integer)) } - def last_active_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def last_active_at=(_) - end + attr_accessor :last_active_at # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -48,74 +28,36 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The name of the vector store. sig { returns(String) } - def name - end - - sig { params(_: String).returns(String) } - def name=(_) - end + attr_accessor :name # The object type, which is always `vector_store`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The status of the vector store, which can be either `expired`, `in_progress`, or # `completed`. A status of `completed` indicates that the vector store is ready # for use. sig { returns(OpenAI::Models::VectorStore::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::VectorStore::Status::TaggedSymbol) - .returns(OpenAI::Models::VectorStore::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The total number of bytes used by the files in the vector store. sig { returns(Integer) } - def usage_bytes - end - - sig { params(_: Integer).returns(Integer) } - def usage_bytes=(_) - end + attr_accessor :usage_bytes # The expiration policy for a vector store. sig { returns(T.nilable(OpenAI::Models::VectorStore::ExpiresAfter)) } - def expires_after - end + attr_reader :expires_after - sig do - params(_: T.any(OpenAI::Models::VectorStore::ExpiresAfter, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::VectorStore::ExpiresAfter, OpenAI::Util::AnyHash)) - end - def expires_after=(_) - end + sig { params(expires_after: T.any(OpenAI::Models::VectorStore::ExpiresAfter, OpenAI::Util::AnyHash)).void } + attr_writer :expires_after # The Unix timestamp (in seconds) for when the vector store will expire. sig { returns(T.nilable(Integer)) } - def expires_at - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def expires_at=(_) - end + attr_accessor :expires_at # A vector store is a collection of processed files can be used by the # `file_search` tool. @@ -174,48 +116,23 @@ module OpenAI class FileCounts < OpenAI::BaseModel # The number of files that were cancelled. sig { returns(Integer) } - def cancelled - end - - sig { params(_: Integer).returns(Integer) } - def cancelled=(_) - end + attr_accessor :cancelled # The number of files that have been successfully processed. sig { returns(Integer) } - def completed - end - - sig { params(_: Integer).returns(Integer) } - def completed=(_) - end + attr_accessor :completed # The number of files that have failed to process. sig { returns(Integer) } - def failed - end - - sig { params(_: Integer).returns(Integer) } - def failed=(_) - end + attr_accessor :failed # The number of files that are currently being processed. sig { returns(Integer) } - def in_progress - end - - sig { params(_: Integer).returns(Integer) } - def in_progress=(_) - end + attr_accessor :in_progress # The total number of files. sig { returns(Integer) } - def total - end - - sig { params(_: Integer).returns(Integer) } - def total=(_) - end + attr_accessor :total sig do params( @@ -268,21 +185,11 @@ module OpenAI # Anchor timestamp after which the expiration policy applies. Supported anchors: # `last_active_at`. sig { returns(Symbol) } - def anchor - end - - sig { params(_: Symbol).returns(Symbol) } - def anchor=(_) - end + attr_accessor :anchor # The number of days after the anchor time that the vector store will expire. sig { returns(Integer) } - def days - end - - sig { params(_: Integer).returns(Integer) } - def days=(_) - end + attr_accessor :days # The expiration policy for a vector store. sig { params(days: Integer, anchor: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/vector_store_create_params.rbi b/rbi/lib/openai/models/vector_store_create_params.rbi index 54ca2316..3799a1d8 100644 --- a/rbi/lib/openai/models/vector_store_create_params.rbi +++ b/rbi/lib/openai/models/vector_store_create_params.rbi @@ -18,50 +18,38 @@ module OpenAI ) ) end - def chunking_strategy - end + attr_reader :chunking_strategy sig do params( - _: T.any( + chunking_strategy: T.any( OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Util::AnyHash, OpenAI::Models::StaticFileChunkingStrategyObjectParam ) ) - .returns( - T.any( - OpenAI::Models::AutoFileChunkingStrategyParam, - OpenAI::Util::AnyHash, - OpenAI::Models::StaticFileChunkingStrategyObjectParam - ) - ) - end - def chunking_strategy=(_) + .void end + attr_writer :chunking_strategy # The expiration policy for a vector store. sig { returns(T.nilable(OpenAI::Models::VectorStoreCreateParams::ExpiresAfter)) } - def expires_after - end + attr_reader :expires_after sig do - params(_: T.any(OpenAI::Models::VectorStoreCreateParams::ExpiresAfter, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::VectorStoreCreateParams::ExpiresAfter, OpenAI::Util::AnyHash)) - end - def expires_after=(_) + params(expires_after: T.any(OpenAI::Models::VectorStoreCreateParams::ExpiresAfter, OpenAI::Util::AnyHash)) + .void end + attr_writer :expires_after # A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that # the vector store should use. Useful for tools like `file_search` that can access # files. sig { returns(T.nilable(T::Array[String])) } - def file_ids - end + attr_reader :file_ids - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + sig { params(file_ids: T::Array[String]).void } + attr_writer :file_ids # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -70,21 +58,14 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The name of the vector store. sig { returns(T.nilable(String)) } - def name - end + attr_reader :name - sig { params(_: String).returns(String) } - def name=(_) - end + sig { params(name: String).void } + attr_writer :name sig do params( @@ -127,21 +108,11 @@ module OpenAI # Anchor timestamp after which the expiration policy applies. Supported anchors: # `last_active_at`. sig { returns(Symbol) } - def anchor - end - - sig { params(_: Symbol).returns(Symbol) } - def anchor=(_) - end + attr_accessor :anchor # The number of days after the anchor time that the vector store will expire. sig { returns(Integer) } - def days - end - - sig { params(_: Integer).returns(Integer) } - def days=(_) - end + attr_accessor :days # The expiration policy for a vector store. sig { params(days: Integer, anchor: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/vector_store_deleted.rbi b/rbi/lib/openai/models/vector_store_deleted.rbi index ede60489..bd0e83c0 100644 --- a/rbi/lib/openai/models/vector_store_deleted.rbi +++ b/rbi/lib/openai/models/vector_store_deleted.rbi @@ -4,28 +4,13 @@ module OpenAI module Models class VectorStoreDeleted < OpenAI::BaseModel sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id sig { returns(T::Boolean) } - def deleted - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def deleted=(_) - end + attr_accessor :deleted sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } def self.new(id:, deleted:, object: :"vector_store.deleted") diff --git a/rbi/lib/openai/models/vector_store_list_params.rbi b/rbi/lib/openai/models/vector_store_list_params.rbi index c0360d6f..0a1e94a2 100644 --- a/rbi/lib/openai/models/vector_store_list_params.rbi +++ b/rbi/lib/openai/models/vector_store_list_params.rbi @@ -11,47 +11,36 @@ module OpenAI # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A cursor for use in pagination. `before` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # starting with obj_foo, your subsequent call can include before=obj_foo in order # to fetch the previous page of the list. sig { returns(T.nilable(String)) } - def before - end + attr_reader :before - sig { params(_: String).returns(String) } - def before=(_) - end + sig { params(before: String).void } + attr_writer :before # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order by the `created_at` timestamp of the objects. `asc` for ascending # order and `desc` for descending order. sig { returns(T.nilable(OpenAI::Models::VectorStoreListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::VectorStoreListParams::Order::OrSymbol) - .returns(OpenAI::Models::VectorStoreListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::VectorStoreListParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/vector_store_search_params.rbi b/rbi/lib/openai/models/vector_store_search_params.rbi index 40bccf18..0e4d0c31 100644 --- a/rbi/lib/openai/models/vector_store_search_params.rbi +++ b/rbi/lib/openai/models/vector_store_search_params.rbi @@ -8,55 +8,46 @@ module OpenAI # A query string for a search sig { returns(T.any(String, T::Array[String])) } - def query - end - - sig { params(_: T.any(String, T::Array[String])).returns(T.any(String, T::Array[String])) } - def query=(_) - end + attr_accessor :query # A filter to apply based on file attributes. sig { returns(T.nilable(T.any(OpenAI::Models::ComparisonFilter, OpenAI::Models::CompoundFilter))) } - def filters - end + attr_reader :filters sig do - params(_: T.any(OpenAI::Models::ComparisonFilter, OpenAI::Util::AnyHash, OpenAI::Models::CompoundFilter)) - .returns(T.any(OpenAI::Models::ComparisonFilter, OpenAI::Util::AnyHash, OpenAI::Models::CompoundFilter)) - end - def filters=(_) + params( + filters: T.any(OpenAI::Models::ComparisonFilter, OpenAI::Util::AnyHash, OpenAI::Models::CompoundFilter) + ) + .void end + attr_writer :filters # The maximum number of results to return. This number should be between 1 and 50 # inclusive. sig { returns(T.nilable(Integer)) } - def max_num_results - end + attr_reader :max_num_results - sig { params(_: Integer).returns(Integer) } - def max_num_results=(_) - end + sig { params(max_num_results: Integer).void } + attr_writer :max_num_results # Ranking options for search. sig { returns(T.nilable(OpenAI::Models::VectorStoreSearchParams::RankingOptions)) } - def ranking_options - end + attr_reader :ranking_options sig do - params(_: T.any(OpenAI::Models::VectorStoreSearchParams::RankingOptions, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::VectorStoreSearchParams::RankingOptions, OpenAI::Util::AnyHash)) - end - def ranking_options=(_) + params( + ranking_options: T.any(OpenAI::Models::VectorStoreSearchParams::RankingOptions, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :ranking_options # Whether to rewrite the natural language query for vector search. sig { returns(T.nilable(T::Boolean)) } - def rewrite_query - end + attr_reader :rewrite_query - sig { params(_: T::Boolean).returns(T::Boolean) } - def rewrite_query=(_) - end + sig { params(rewrite_query: T::Boolean).void } + attr_writer :rewrite_query sig do params( @@ -119,23 +110,16 @@ module OpenAI class RankingOptions < OpenAI::BaseModel sig { returns(T.nilable(OpenAI::Models::VectorStoreSearchParams::RankingOptions::Ranker::OrSymbol)) } - def ranker - end + attr_reader :ranker - sig do - params(_: OpenAI::Models::VectorStoreSearchParams::RankingOptions::Ranker::OrSymbol) - .returns(OpenAI::Models::VectorStoreSearchParams::RankingOptions::Ranker::OrSymbol) - end - def ranker=(_) - end + sig { params(ranker: OpenAI::Models::VectorStoreSearchParams::RankingOptions::Ranker::OrSymbol).void } + attr_writer :ranker sig { returns(T.nilable(Float)) } - def score_threshold - end + attr_reader :score_threshold - sig { params(_: Float).returns(Float) } - def score_threshold=(_) - end + sig { params(score_threshold: Float).void } + attr_writer :score_threshold # Ranking options for search. sig do diff --git a/rbi/lib/openai/models/vector_store_search_response.rbi b/rbi/lib/openai/models/vector_store_search_response.rbi index 1847ed36..a9a8d0fc 100644 --- a/rbi/lib/openai/models/vector_store_search_response.rbi +++ b/rbi/lib/openai/models/vector_store_search_response.rbi @@ -9,54 +9,23 @@ module OpenAI # length of 64 characters. Values are strings with a maximum length of 512 # characters, booleans, or numbers. sig { returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) } - def attributes - end - - sig do - params(_: T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - .returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - end - def attributes=(_) - end + attr_accessor :attributes # Content chunks from the file. sig { returns(T::Array[OpenAI::Models::VectorStoreSearchResponse::Content]) } - def content - end - - sig do - params(_: T::Array[OpenAI::Models::VectorStoreSearchResponse::Content]) - .returns(T::Array[OpenAI::Models::VectorStoreSearchResponse::Content]) - end - def content=(_) - end + attr_accessor :content # The ID of the vector store file. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # The name of the vector store file. sig { returns(String) } - def filename - end - - sig { params(_: String).returns(String) } - def filename=(_) - end + attr_accessor :filename # The similarity score for the result. sig { returns(Float) } - def score - end - - sig { params(_: Float).returns(Float) } - def score=(_) - end + attr_accessor :score sig do params( @@ -101,24 +70,11 @@ module OpenAI class Content < OpenAI::BaseModel # The text content returned from search. sig { returns(String) } - def text - end - - sig { params(_: String).returns(String) } - def text=(_) - end + attr_accessor :text # The type of content. sig { returns(OpenAI::Models::VectorStoreSearchResponse::Content::Type::TaggedSymbol) } - def type - end - - sig do - params(_: OpenAI::Models::VectorStoreSearchResponse::Content::Type::TaggedSymbol) - .returns(OpenAI::Models::VectorStoreSearchResponse::Content::Type::TaggedSymbol) - end - def type=(_) - end + attr_accessor :type sig do params(text: String, type: OpenAI::Models::VectorStoreSearchResponse::Content::Type::OrSymbol) diff --git a/rbi/lib/openai/models/vector_store_update_params.rbi b/rbi/lib/openai/models/vector_store_update_params.rbi index 2415457b..e7c42739 100644 --- a/rbi/lib/openai/models/vector_store_update_params.rbi +++ b/rbi/lib/openai/models/vector_store_update_params.rbi @@ -8,15 +8,15 @@ module OpenAI # The expiration policy for a vector store. sig { returns(T.nilable(OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter)) } - def expires_after - end + attr_reader :expires_after sig do - params(_: T.nilable(T.any(OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter, OpenAI::Util::AnyHash))) - .returns(T.nilable(T.any(OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter, OpenAI::Util::AnyHash))) - end - def expires_after=(_) + params( + expires_after: T.nilable(T.any(OpenAI::Models::VectorStoreUpdateParams::ExpiresAfter, OpenAI::Util::AnyHash)) + ) + .void end + attr_writer :expires_after # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -25,21 +25,11 @@ module OpenAI # Keys are strings with a maximum length of 64 characters. Values are strings with # a maximum length of 512 characters. sig { returns(T.nilable(T::Hash[Symbol, String])) } - def metadata - end - - sig { params(_: T.nilable(T::Hash[Symbol, String])).returns(T.nilable(T::Hash[Symbol, String])) } - def metadata=(_) - end + attr_accessor :metadata # The name of the vector store. sig { returns(T.nilable(String)) } - def name - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def name=(_) - end + attr_accessor :name sig do params( @@ -71,21 +61,11 @@ module OpenAI # Anchor timestamp after which the expiration policy applies. Supported anchors: # `last_active_at`. sig { returns(Symbol) } - def anchor - end - - sig { params(_: Symbol).returns(Symbol) } - def anchor=(_) - end + attr_accessor :anchor # The number of days after the anchor time that the vector store will expire. sig { returns(Integer) } - def days - end - - sig { params(_: Integer).returns(Integer) } - def days=(_) - end + attr_accessor :days # The expiration policy for a vector store. sig { params(days: Integer, anchor: Symbol).returns(T.attached_class) } diff --git a/rbi/lib/openai/models/vector_stores/file_batch_cancel_params.rbi b/rbi/lib/openai/models/vector_stores/file_batch_cancel_params.rbi index c1334d3d..764c2bb2 100644 --- a/rbi/lib/openai/models/vector_stores/file_batch_cancel_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_batch_cancel_params.rbi @@ -8,12 +8,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi b/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi index 1a242819..c8da7a14 100644 --- a/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_batch_create_params.rbi @@ -11,12 +11,7 @@ module OpenAI # the vector store should use. Useful for tools like `file_search` that can access # files. sig { returns(T::Array[String]) } - def file_ids - end - - sig { params(_: T::Array[String]).returns(T::Array[String]) } - def file_ids=(_) - end + attr_accessor :file_ids # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -24,15 +19,7 @@ module OpenAI # length of 64 characters. Values are strings with a maximum length of 512 # characters, booleans, or numbers. sig { returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) } - def attributes - end - - sig do - params(_: T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - .returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - end - def attributes=(_) - end + attr_accessor :attributes # The chunking strategy used to chunk the file(s). If not set, will use the `auto` # strategy. Only applicable if `file_ids` is non-empty. @@ -46,27 +33,19 @@ module OpenAI ) ) end - def chunking_strategy - end + attr_reader :chunking_strategy sig do params( - _: T.any( + chunking_strategy: T.any( OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Util::AnyHash, OpenAI::Models::StaticFileChunkingStrategyObjectParam ) ) - .returns( - T.any( - OpenAI::Models::AutoFileChunkingStrategyParam, - OpenAI::Util::AnyHash, - OpenAI::Models::StaticFileChunkingStrategyObjectParam - ) - ) - end - def chunking_strategy=(_) + .void end + attr_writer :chunking_strategy sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi b/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi index 367b7a22..65b17181 100644 --- a/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_batch_list_files_params.rbi @@ -8,71 +8,50 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id # A cursor for use in pagination. `after` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A cursor for use in pagination. `before` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # starting with obj_foo, your subsequent call can include before=obj_foo in order # to fetch the previous page of the list. sig { returns(T.nilable(String)) } - def before - end + attr_reader :before - sig { params(_: String).returns(String) } - def before=(_) - end + sig { params(before: String).void } + attr_writer :before # Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. sig { returns(T.nilable(OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter::OrSymbol)) } - def filter - end + attr_reader :filter - sig do - params(_: OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter::OrSymbol) - .returns(OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter::OrSymbol) - end - def filter=(_) - end + sig { params(filter: OpenAI::Models::VectorStores::FileBatchListFilesParams::Filter::OrSymbol).void } + attr_writer :filter # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order by the `created_at` timestamp of the objects. `asc` for ascending # order and `desc` for descending order. sig { returns(T.nilable(OpenAI::Models::VectorStores::FileBatchListFilesParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::VectorStores::FileBatchListFilesParams::Order::OrSymbol) - .returns(OpenAI::Models::VectorStores::FileBatchListFilesParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::VectorStores::FileBatchListFilesParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_batch_retrieve_params.rbi b/rbi/lib/openai/models/vector_stores/file_batch_retrieve_params.rbi index 0935490b..c637f31e 100644 --- a/rbi/lib/openai/models/vector_stores/file_batch_retrieve_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_batch_retrieve_params.rbi @@ -8,12 +8,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_content_params.rbi b/rbi/lib/openai/models/vector_stores/file_content_params.rbi index d87f0929..6d9ffc4f 100644 --- a/rbi/lib/openai/models/vector_stores/file_content_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_content_params.rbi @@ -8,12 +8,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_content_response.rbi b/rbi/lib/openai/models/vector_stores/file_content_response.rbi index 7986b030..1fad3ed9 100644 --- a/rbi/lib/openai/models/vector_stores/file_content_response.rbi +++ b/rbi/lib/openai/models/vector_stores/file_content_response.rbi @@ -6,21 +6,17 @@ module OpenAI class FileContentResponse < OpenAI::BaseModel # The text content sig { returns(T.nilable(String)) } - def text - end + attr_reader :text - sig { params(_: String).returns(String) } - def text=(_) - end + sig { params(text: String).void } + attr_writer :text # The content type (currently only `"text"`) sig { returns(T.nilable(String)) } - def type - end + attr_reader :type - sig { params(_: String).returns(String) } - def type=(_) - end + sig { params(type: String).void } + attr_writer :type sig { params(text: String, type: String).returns(T.attached_class) } def self.new(text: nil, type: nil) diff --git a/rbi/lib/openai/models/vector_stores/file_create_params.rbi b/rbi/lib/openai/models/vector_stores/file_create_params.rbi index e84068ca..e0b2f3f4 100644 --- a/rbi/lib/openai/models/vector_stores/file_create_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_create_params.rbi @@ -11,12 +11,7 @@ module OpenAI # vector store should use. Useful for tools like `file_search` that can access # files. sig { returns(String) } - def file_id - end - - sig { params(_: String).returns(String) } - def file_id=(_) - end + attr_accessor :file_id # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -24,15 +19,7 @@ module OpenAI # length of 64 characters. Values are strings with a maximum length of 512 # characters, booleans, or numbers. sig { returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) } - def attributes - end - - sig do - params(_: T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - .returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - end - def attributes=(_) - end + attr_accessor :attributes # The chunking strategy used to chunk the file(s). If not set, will use the `auto` # strategy. Only applicable if `file_ids` is non-empty. @@ -46,27 +33,19 @@ module OpenAI ) ) end - def chunking_strategy - end + attr_reader :chunking_strategy sig do params( - _: T.any( + chunking_strategy: T.any( OpenAI::Models::AutoFileChunkingStrategyParam, OpenAI::Util::AnyHash, OpenAI::Models::StaticFileChunkingStrategyObjectParam ) ) - .returns( - T.any( - OpenAI::Models::AutoFileChunkingStrategyParam, - OpenAI::Util::AnyHash, - OpenAI::Models::StaticFileChunkingStrategyObjectParam - ) - ) - end - def chunking_strategy=(_) + .void end + attr_writer :chunking_strategy sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_delete_params.rbi b/rbi/lib/openai/models/vector_stores/file_delete_params.rbi index 8277a73f..4c8aa466 100644 --- a/rbi/lib/openai/models/vector_stores/file_delete_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_delete_params.rbi @@ -8,12 +8,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_list_params.rbi b/rbi/lib/openai/models/vector_stores/file_list_params.rbi index f123f36a..edce777d 100644 --- a/rbi/lib/openai/models/vector_stores/file_list_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_list_params.rbi @@ -12,59 +12,43 @@ module OpenAI # ending with obj_foo, your subsequent call can include after=obj_foo in order to # fetch the next page of the list. sig { returns(T.nilable(String)) } - def after - end + attr_reader :after - sig { params(_: String).returns(String) } - def after=(_) - end + sig { params(after: String).void } + attr_writer :after # A cursor for use in pagination. `before` is an object ID that defines your place # in the list. For instance, if you make a list request and receive 100 objects, # starting with obj_foo, your subsequent call can include before=obj_foo in order # to fetch the previous page of the list. sig { returns(T.nilable(String)) } - def before - end + attr_reader :before - sig { params(_: String).returns(String) } - def before=(_) - end + sig { params(before: String).void } + attr_writer :before # Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. sig { returns(T.nilable(OpenAI::Models::VectorStores::FileListParams::Filter::OrSymbol)) } - def filter - end + attr_reader :filter - sig do - params(_: OpenAI::Models::VectorStores::FileListParams::Filter::OrSymbol) - .returns(OpenAI::Models::VectorStores::FileListParams::Filter::OrSymbol) - end - def filter=(_) - end + sig { params(filter: OpenAI::Models::VectorStores::FileListParams::Filter::OrSymbol).void } + attr_writer :filter # A limit on the number of objects to be returned. Limit can range between 1 and # 100, and the default is 20. sig { returns(T.nilable(Integer)) } - def limit - end + attr_reader :limit - sig { params(_: Integer).returns(Integer) } - def limit=(_) - end + sig { params(limit: Integer).void } + attr_writer :limit # Sort order by the `created_at` timestamp of the objects. `asc` for ascending # order and `desc` for descending order. sig { returns(T.nilable(OpenAI::Models::VectorStores::FileListParams::Order::OrSymbol)) } - def order - end + attr_reader :order - sig do - params(_: OpenAI::Models::VectorStores::FileListParams::Order::OrSymbol) - .returns(OpenAI::Models::VectorStores::FileListParams::Order::OrSymbol) - end - def order=(_) - end + sig { params(order: OpenAI::Models::VectorStores::FileListParams::Order::OrSymbol).void } + attr_writer :order sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_retrieve_params.rbi b/rbi/lib/openai/models/vector_stores/file_retrieve_params.rbi index a69049b2..a7d5c319 100644 --- a/rbi/lib/openai/models/vector_stores/file_retrieve_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_retrieve_params.rbi @@ -8,12 +8,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id sig do params( diff --git a/rbi/lib/openai/models/vector_stores/file_update_params.rbi b/rbi/lib/openai/models/vector_stores/file_update_params.rbi index b74c3292..3c552da3 100644 --- a/rbi/lib/openai/models/vector_stores/file_update_params.rbi +++ b/rbi/lib/openai/models/vector_stores/file_update_params.rbi @@ -8,12 +8,7 @@ module OpenAI include OpenAI::RequestParameters sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -21,15 +16,7 @@ module OpenAI # length of 64 characters. Values are strings with a maximum length of 512 # characters, booleans, or numbers. sig { returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) } - def attributes - end - - sig do - params(_: T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - .returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - end - def attributes=(_) - end + attr_accessor :attributes sig do params( diff --git a/rbi/lib/openai/models/vector_stores/vector_store_file.rbi b/rbi/lib/openai/models/vector_stores/vector_store_file.rbi index 7d337918..3e32084e 100644 --- a/rbi/lib/openai/models/vector_stores/vector_store_file.rbi +++ b/rbi/lib/openai/models/vector_stores/vector_store_file.rbi @@ -6,81 +6,46 @@ module OpenAI class VectorStoreFile < OpenAI::BaseModel # The identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the vector store file was created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at # The last error associated with this vector store file. Will be `null` if there # are no errors. sig { returns(T.nilable(OpenAI::Models::VectorStores::VectorStoreFile::LastError)) } - def last_error - end + attr_reader :last_error sig do params( - _: T.nilable(T.any(OpenAI::Models::VectorStores::VectorStoreFile::LastError, OpenAI::Util::AnyHash)) + last_error: T.nilable(T.any(OpenAI::Models::VectorStores::VectorStoreFile::LastError, OpenAI::Util::AnyHash)) ) - .returns(T.nilable(T.any(OpenAI::Models::VectorStores::VectorStoreFile::LastError, OpenAI::Util::AnyHash))) - end - def last_error=(_) + .void end + attr_writer :last_error # The object type, which is always `vector_store.file`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The status of the vector store file, which can be either `in_progress`, # `completed`, `cancelled`, or `failed`. The status `completed` indicates that the # vector store file is ready for use. sig { returns(OpenAI::Models::VectorStores::VectorStoreFile::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::VectorStores::VectorStoreFile::Status::TaggedSymbol) - .returns(OpenAI::Models::VectorStores::VectorStoreFile::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The total vector store usage in bytes. Note that this may be different from the # original file size. sig { returns(Integer) } - def usage_bytes - end - - sig { params(_: Integer).returns(Integer) } - def usage_bytes=(_) - end + attr_accessor :usage_bytes # The ID of the # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) # that the [File](https://platform.openai.com/docs/api-reference/files) is # attached to. sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id # Set of 16 key-value pairs that can be attached to an object. This can be useful # for storing additional information about the object in a structured format, and @@ -88,15 +53,7 @@ module OpenAI # length of 64 characters. Values are strings with a maximum length of 512 # characters, booleans, or numbers. sig { returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) } - def attributes - end - - sig do - params(_: T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - .returns(T.nilable(T::Hash[Symbol, T.any(String, Float, T::Boolean)])) - end - def attributes=(_) - end + attr_accessor :attributes # The strategy used to chunk the file. sig do @@ -106,27 +63,19 @@ module OpenAI ) ) end - def chunking_strategy - end + attr_reader :chunking_strategy sig do params( - _: T.any( + chunking_strategy: T.any( OpenAI::Models::StaticFileChunkingStrategyObject, OpenAI::Util::AnyHash, OpenAI::Models::OtherFileChunkingStrategyObject ) ) - .returns( - T.any( - OpenAI::Models::StaticFileChunkingStrategyObject, - OpenAI::Util::AnyHash, - OpenAI::Models::OtherFileChunkingStrategyObject - ) - ) - end - def chunking_strategy=(_) + .void end + attr_writer :chunking_strategy # A list of files attached to a vector store. sig do @@ -182,24 +131,11 @@ module OpenAI class LastError < OpenAI::BaseModel # One of `server_error` or `rate_limit_exceeded`. sig { returns(OpenAI::Models::VectorStores::VectorStoreFile::LastError::Code::TaggedSymbol) } - def code - end - - sig do - params(_: OpenAI::Models::VectorStores::VectorStoreFile::LastError::Code::TaggedSymbol) - .returns(OpenAI::Models::VectorStores::VectorStoreFile::LastError::Code::TaggedSymbol) - end - def code=(_) - end + attr_accessor :code # A human-readable description of the error. sig { returns(String) } - def message - end - - sig { params(_: String).returns(String) } - def message=(_) - end + attr_accessor :message # The last error associated with this vector store file. Will be `null` if there # are no errors. diff --git a/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi b/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi index e2b512ef..dd1ee3e5 100644 --- a/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi +++ b/rbi/lib/openai/models/vector_stores/vector_store_file_batch.rbi @@ -6,67 +6,39 @@ module OpenAI class VectorStoreFileBatch < OpenAI::BaseModel # The identifier, which can be referenced in API endpoints. sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id # The Unix timestamp (in seconds) for when the vector store files batch was # created. sig { returns(Integer) } - def created_at - end - - sig { params(_: Integer).returns(Integer) } - def created_at=(_) - end + attr_accessor :created_at sig { returns(OpenAI::Models::VectorStores::VectorStoreFileBatch::FileCounts) } - def file_counts - end + attr_reader :file_counts sig do - params(_: T.any(OpenAI::Models::VectorStores::VectorStoreFileBatch::FileCounts, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::Models::VectorStores::VectorStoreFileBatch::FileCounts, OpenAI::Util::AnyHash)) - end - def file_counts=(_) + params( + file_counts: T.any(OpenAI::Models::VectorStores::VectorStoreFileBatch::FileCounts, OpenAI::Util::AnyHash) + ) + .void end + attr_writer :file_counts # The object type, which is always `vector_store.file_batch`. sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object # The status of the vector store files batch, which can be either `in_progress`, # `completed`, `cancelled` or `failed`. sig { returns(OpenAI::Models::VectorStores::VectorStoreFileBatch::Status::TaggedSymbol) } - def status - end - - sig do - params(_: OpenAI::Models::VectorStores::VectorStoreFileBatch::Status::TaggedSymbol) - .returns(OpenAI::Models::VectorStores::VectorStoreFileBatch::Status::TaggedSymbol) - end - def status=(_) - end + attr_accessor :status # The ID of the # [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) # that the [File](https://platform.openai.com/docs/api-reference/files) is # attached to. sig { returns(String) } - def vector_store_id - end - - sig { params(_: String).returns(String) } - def vector_store_id=(_) - end + attr_accessor :vector_store_id # A batch of files attached to a vector store. sig do @@ -102,48 +74,23 @@ module OpenAI class FileCounts < OpenAI::BaseModel # The number of files that where cancelled. sig { returns(Integer) } - def cancelled - end - - sig { params(_: Integer).returns(Integer) } - def cancelled=(_) - end + attr_accessor :cancelled # The number of files that have been processed. sig { returns(Integer) } - def completed - end - - sig { params(_: Integer).returns(Integer) } - def completed=(_) - end + attr_accessor :completed # The number of files that have failed to process. sig { returns(Integer) } - def failed - end - - sig { params(_: Integer).returns(Integer) } - def failed=(_) - end + attr_accessor :failed # The number of files that are currently being processed. sig { returns(Integer) } - def in_progress - end - - sig { params(_: Integer).returns(Integer) } - def in_progress=(_) - end + attr_accessor :in_progress # The total number of files. sig { returns(Integer) } - def total - end - - sig { params(_: Integer).returns(Integer) } - def total=(_) - end + attr_accessor :total sig do params( diff --git a/rbi/lib/openai/models/vector_stores/vector_store_file_deleted.rbi b/rbi/lib/openai/models/vector_stores/vector_store_file_deleted.rbi index d7a5a707..6c4d25fa 100644 --- a/rbi/lib/openai/models/vector_stores/vector_store_file_deleted.rbi +++ b/rbi/lib/openai/models/vector_stores/vector_store_file_deleted.rbi @@ -5,28 +5,13 @@ module OpenAI module VectorStores class VectorStoreFileDeleted < OpenAI::BaseModel sig { returns(String) } - def id - end - - sig { params(_: String).returns(String) } - def id=(_) - end + attr_accessor :id sig { returns(T::Boolean) } - def deleted - end - - sig { params(_: T::Boolean).returns(T::Boolean) } - def deleted=(_) - end + attr_accessor :deleted sig { returns(Symbol) } - def object - end - - sig { params(_: Symbol).returns(Symbol) } - def object=(_) - end + attr_accessor :object sig { params(id: String, deleted: T::Boolean, object: Symbol).returns(T.attached_class) } def self.new(id:, deleted:, object: :"vector_store.file.deleted") diff --git a/rbi/lib/openai/page.rbi b/rbi/lib/openai/page.rbi index 41e78793..5ef61d62 100644 --- a/rbi/lib/openai/page.rbi +++ b/rbi/lib/openai/page.rbi @@ -7,20 +7,10 @@ module OpenAI Elem = type_member sig { returns(T.nilable(T::Array[Elem])) } - def data - end - - sig { params(_: T.nilable(T::Array[Elem])).returns(T.nilable(T::Array[Elem])) } - def data=(_) - end + attr_accessor :data sig { returns(String) } - def object - end - - sig { params(_: String).returns(String) } - def object=(_) - end + attr_accessor :object sig { returns(String) } def inspect diff --git a/rbi/lib/openai/request_options.rbi b/rbi/lib/openai/request_options.rbi index 4f198f23..51fb5512 100644 --- a/rbi/lib/openai/request_options.rbi +++ b/rbi/lib/openai/request_options.rbi @@ -5,15 +5,7 @@ module OpenAI module RequestParameters # Options to specify HTTP behaviour for this request. sig { returns(T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash)) } - def request_options - end - - sig do - params(_: T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash)) - .returns(T.any(OpenAI::RequestOptions, OpenAI::Util::AnyHash)) - end - def request_options=(_) - end + attr_accessor :request_options # @api private module Converter @@ -38,66 +30,30 @@ module OpenAI # Idempotency key to send with request and all associated retries. Will only be # sent for write requests. sig { returns(T.nilable(String)) } - def idempotency_key - end - - sig { params(_: T.nilable(String)).returns(T.nilable(String)) } - def idempotency_key=(_) - end + attr_accessor :idempotency_key # Extra query params to send with the request. These are `.merge`’d into any # `query` given at the client level. sig { returns(T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) } - def extra_query - end - - sig do - params(_: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) - .returns(T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])) - end - def extra_query=(_) - end + attr_accessor :extra_query # Extra headers to send with the request. These are `.merged`’d into any # `extra_headers` given at the client level. sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) } - def extra_headers - end - - sig do - params(_: T.nilable(T::Hash[String, T.nilable(String)])) - .returns(T.nilable(T::Hash[String, T.nilable(String)])) - end - def extra_headers=(_) - end + attr_accessor :extra_headers # Extra data to send with the request. These are deep merged into any data # generated as part of the normal request. sig { returns(T.nilable(T.anything)) } - def extra_body - end - - sig { params(_: T.nilable(T.anything)).returns(T.nilable(T.anything)) } - def extra_body=(_) - end + attr_accessor :extra_body # Maximum number of retries to attempt after a failed initial request. sig { returns(T.nilable(Integer)) } - def max_retries - end - - sig { params(_: T.nilable(Integer)).returns(T.nilable(Integer)) } - def max_retries=(_) - end + attr_accessor :max_retries # Request timeout in seconds. sig { returns(T.nilable(Float)) } - def timeout - end - - sig { params(_: T.nilable(Float)).returns(T.nilable(Float)) } - def timeout=(_) - end + attr_accessor :timeout # Returns a new instance of RequestOptions. sig { params(values: OpenAI::Util::AnyHash).returns(T.attached_class) } diff --git a/rbi/lib/openai/resources/audio.rbi b/rbi/lib/openai/resources/audio.rbi index c3381f2e..353012c6 100644 --- a/rbi/lib/openai/resources/audio.rbi +++ b/rbi/lib/openai/resources/audio.rbi @@ -4,16 +4,13 @@ module OpenAI module Resources class Audio sig { returns(OpenAI::Resources::Audio::Transcriptions) } - def transcriptions - end + attr_reader :transcriptions sig { returns(OpenAI::Resources::Audio::Translations) } - def translations - end + attr_reader :translations sig { returns(OpenAI::Resources::Audio::Speech) } - def speech - end + attr_reader :speech sig { params(client: OpenAI::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/lib/openai/resources/beta.rbi b/rbi/lib/openai/resources/beta.rbi index 3e97021d..eebedd02 100644 --- a/rbi/lib/openai/resources/beta.rbi +++ b/rbi/lib/openai/resources/beta.rbi @@ -4,12 +4,10 @@ module OpenAI module Resources class Beta sig { returns(OpenAI::Resources::Beta::Assistants) } - def assistants - end + attr_reader :assistants sig { returns(OpenAI::Resources::Beta::Threads) } - def threads - end + attr_reader :threads sig { params(client: OpenAI::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/lib/openai/resources/beta/threads.rbi b/rbi/lib/openai/resources/beta/threads.rbi index 9e668eee..2c2ac7ef 100644 --- a/rbi/lib/openai/resources/beta/threads.rbi +++ b/rbi/lib/openai/resources/beta/threads.rbi @@ -5,12 +5,10 @@ module OpenAI class Beta class Threads sig { returns(OpenAI::Resources::Beta::Threads::Runs) } - def runs - end + attr_reader :runs sig { returns(OpenAI::Resources::Beta::Threads::Messages) } - def messages - end + attr_reader :messages # Create a thread. sig do diff --git a/rbi/lib/openai/resources/beta/threads/runs.rbi b/rbi/lib/openai/resources/beta/threads/runs.rbi index d797090c..71cf02b1 100644 --- a/rbi/lib/openai/resources/beta/threads/runs.rbi +++ b/rbi/lib/openai/resources/beta/threads/runs.rbi @@ -6,8 +6,7 @@ module OpenAI class Threads class Runs sig { returns(OpenAI::Resources::Beta::Threads::Runs::Steps) } - def steps - end + attr_reader :steps # Create a run. sig do diff --git a/rbi/lib/openai/resources/chat.rbi b/rbi/lib/openai/resources/chat.rbi index 4d090d3f..98440959 100644 --- a/rbi/lib/openai/resources/chat.rbi +++ b/rbi/lib/openai/resources/chat.rbi @@ -4,8 +4,7 @@ module OpenAI module Resources class Chat sig { returns(OpenAI::Resources::Chat::Completions) } - def completions - end + attr_reader :completions sig { params(client: OpenAI::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/lib/openai/resources/chat/completions.rbi b/rbi/lib/openai/resources/chat/completions.rbi index 91d89d3d..58bc7161 100644 --- a/rbi/lib/openai/resources/chat/completions.rbi +++ b/rbi/lib/openai/resources/chat/completions.rbi @@ -5,8 +5,7 @@ module OpenAI class Chat class Completions sig { returns(OpenAI::Resources::Chat::Completions::Messages) } - def messages - end + attr_reader :messages # **Starting a new project?** We recommend trying # [Responses](https://platform.openai.com/docs/api-reference/responses) to take diff --git a/rbi/lib/openai/resources/fine_tuning.rbi b/rbi/lib/openai/resources/fine_tuning.rbi index 0699b0ee..f2743caa 100644 --- a/rbi/lib/openai/resources/fine_tuning.rbi +++ b/rbi/lib/openai/resources/fine_tuning.rbi @@ -4,8 +4,7 @@ module OpenAI module Resources class FineTuning sig { returns(OpenAI::Resources::FineTuning::Jobs) } - def jobs - end + attr_reader :jobs sig { params(client: OpenAI::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/lib/openai/resources/fine_tuning/jobs.rbi b/rbi/lib/openai/resources/fine_tuning/jobs.rbi index df149226..7d8544da 100644 --- a/rbi/lib/openai/resources/fine_tuning/jobs.rbi +++ b/rbi/lib/openai/resources/fine_tuning/jobs.rbi @@ -5,8 +5,7 @@ module OpenAI class FineTuning class Jobs sig { returns(OpenAI::Resources::FineTuning::Jobs::Checkpoints) } - def checkpoints - end + attr_reader :checkpoints # Creates a fine-tuning job which begins the process of creating a new model from # a given dataset. diff --git a/rbi/lib/openai/resources/responses.rbi b/rbi/lib/openai/resources/responses.rbi index 61ac293c..6ddca1da 100644 --- a/rbi/lib/openai/resources/responses.rbi +++ b/rbi/lib/openai/resources/responses.rbi @@ -4,8 +4,7 @@ module OpenAI module Resources class Responses sig { returns(OpenAI::Resources::Responses::InputItems) } - def input_items - end + attr_reader :input_items # Creates a model response. Provide # [text](https://platform.openai.com/docs/guides/text) or diff --git a/rbi/lib/openai/resources/uploads.rbi b/rbi/lib/openai/resources/uploads.rbi index 863418f5..55b2b24e 100644 --- a/rbi/lib/openai/resources/uploads.rbi +++ b/rbi/lib/openai/resources/uploads.rbi @@ -4,8 +4,7 @@ module OpenAI module Resources class Uploads sig { returns(OpenAI::Resources::Uploads::Parts) } - def parts - end + attr_reader :parts # Creates an intermediate # [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object diff --git a/rbi/lib/openai/resources/vector_stores.rbi b/rbi/lib/openai/resources/vector_stores.rbi index 6f4b48c7..0c24ebc9 100644 --- a/rbi/lib/openai/resources/vector_stores.rbi +++ b/rbi/lib/openai/resources/vector_stores.rbi @@ -4,12 +4,10 @@ module OpenAI module Resources class VectorStores sig { returns(OpenAI::Resources::VectorStores::Files) } - def files - end + attr_reader :files sig { returns(OpenAI::Resources::VectorStores::FileBatches) } - def file_batches - end + attr_reader :file_batches # Create a vector store. sig do