From 98a56b4c6a1cae0ebf4c0d9bc75933fbcd74af9f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:48:54 +0000 Subject: [PATCH 1/2] feat(api): dev day 2025 launches DevDay 2025 launches including videos and chatkit beta --- .stats.yml | 8 +- lib/openai.rb | 46 ++ lib/openai/client.rb | 4 + .../internal/conversation_cursor_page.rb | 4 +- lib/openai/models.rb | 22 + lib/openai/models/all_models.rb | 2 + .../models/beta/chatkit/chat_session.rb | 94 +++ .../chat_session_automatic_thread_titling.rb | 22 + .../chat_session_chatkit_configuration.rb | 38 ++ ...hat_session_chatkit_configuration_param.rb | 125 ++++ .../chat_session_expires_after_param.rb | 30 + .../beta/chatkit/chat_session_file_upload.rb | 38 ++ .../beta/chatkit/chat_session_history.rb | 34 + .../beta/chatkit/chat_session_rate_limits.rb | 22 + .../chatkit/chat_session_rate_limits_param.rb | 22 + .../beta/chatkit/chat_session_status.rb | 20 + .../chatkit/chat_session_workflow_param.rb | 80 +++ .../models/beta/chatkit/chatkit_attachment.rb | 69 ++ .../chatkit/chatkit_response_output_text.rb | 143 +++++ .../models/beta/chatkit/chatkit_thread.rb | 145 +++++ .../chatkit_thread_assistant_message_item.rb | 65 ++ .../beta/chatkit/chatkit_thread_item_list.rb | 374 +++++++++++ .../chatkit_thread_user_message_item.rb | 183 ++++++ .../beta/chatkit/chatkit_widget_item.rb | 64 ++ .../beta/chatkit/session_cancel_params.rb | 18 + .../beta/chatkit/session_create_params.rb | 63 ++ .../beta/chatkit/thread_delete_params.rb | 18 + .../beta/chatkit/thread_delete_response.rb | 39 ++ .../beta/chatkit/thread_list_items_params.rb | 66 ++ .../models/beta/chatkit/thread_list_params.rb | 75 +++ .../beta/chatkit/thread_retrieve_params.rb | 18 + .../models/beta/chatkit_upload_file_params.rb | 28 + .../beta/chatkit_upload_file_response.rb | 25 + lib/openai/models/beta/chatkit_workflow.rb | 78 +++ lib/openai/models/beta/file_part.rb | 56 ++ lib/openai/models/beta/image_part.rb | 64 ++ lib/openai/models/image_edit_params.rb | 6 +- lib/openai/models/image_model.rb | 1 + .../models/realtime/realtime_session.rb | 4 + .../realtime_session_create_request.rb | 12 + .../realtime_session_create_response.rb | 12 + lib/openai/models/responses/tool.rb | 7 +- lib/openai/models/responses_model.rb | 2 + lib/openai/models/video.rb | 122 ++++ lib/openai/models/video_create_error.rb | 21 + lib/openai/models/video_create_params.rb | 54 ++ lib/openai/models/video_delete_params.rb | 14 + lib/openai/models/video_delete_response.rb | 35 ++ .../models/video_download_content_params.rb | 34 + lib/openai/models/video_list_params.rb | 54 ++ lib/openai/models/video_model.rb | 15 + lib/openai/models/video_remix_params.rb | 22 + lib/openai/models/video_retrieve_params.rb | 14 + lib/openai/models/video_seconds.rb | 16 + lib/openai/models/video_size.rb | 17 + lib/openai/resources/beta.rb | 4 + lib/openai/resources/beta/chatkit.rb | 50 ++ lib/openai/resources/beta/chatkit/sessions.rb | 71 +++ lib/openai/resources/beta/chatkit/threads.rb | 126 ++++ lib/openai/resources/videos.rb | 165 +++++ rbi/openai/client.rbi | 3 + rbi/openai/models.rbi | 22 + rbi/openai/models/all_models.rbi | 10 + .../models/beta/chatkit/chat_session.rbi | 141 +++++ .../chat_session_automatic_thread_titling.rbi | 35 ++ .../chat_session_chatkit_configuration.rbi | 87 +++ ...at_session_chatkit_configuration_param.rbi | 256 ++++++++ .../chat_session_expires_after_param.rbi | 43 ++ .../beta/chatkit/chat_session_file_upload.rbi | 61 ++ .../beta/chatkit/chat_session_history.rbi | 52 ++ .../beta/chatkit/chat_session_rate_limits.rbi | 37 ++ .../chat_session_rate_limits_param.rbi | 40 ++ .../beta/chatkit/chat_session_status.rbi | 43 ++ .../chatkit/chat_session_workflow_param.rbi | 166 +++++ .../beta/chatkit/chatkit_attachment.rbi | 116 ++++ .../chatkit/chatkit_response_output_text.rbi | 287 +++++++++ .../models/beta/chatkit/chatkit_thread.rbi | 220 +++++++ .../chatkit_thread_assistant_message_item.rbi | 94 +++ .../beta/chatkit/chatkit_thread_item_list.rbi | 590 ++++++++++++++++++ .../chatkit_thread_user_message_item.rbi | 324 ++++++++++ .../beta/chatkit/chatkit_widget_item.rbi | 87 +++ .../beta/chatkit/session_cancel_params.rbi | 34 + .../beta/chatkit/session_create_params.rbi | 136 ++++ .../beta/chatkit/thread_delete_params.rbi | 34 + .../beta/chatkit/thread_delete_response.rbi | 55 ++ .../beta/chatkit/thread_list_items_params.rbi | 138 ++++ .../beta/chatkit/thread_list_params.rbi | 145 +++++ .../beta/chatkit/thread_retrieve_params.rbi | 34 + .../beta/chatkit_upload_file_params.rbi | 50 ++ .../beta/chatkit_upload_file_response.rbi | 25 + rbi/openai/models/beta/chatkit_workflow.rbi | 134 ++++ rbi/openai/models/beta/file_part.rbi | 74 +++ rbi/openai/models/beta/image_part.rbi | 82 +++ rbi/openai/models/image_edit_params.rbi | 9 +- rbi/openai/models/image_model.rbi | 2 + .../models/realtime/realtime_session.rbi | 20 + .../realtime_session_create_request.rbi | 20 + .../realtime_session_create_response.rbi | 20 + rbi/openai/models/responses/tool.rbi | 14 +- rbi/openai/models/responses_model.rbi | 10 + rbi/openai/models/video.rbi | 143 +++++ rbi/openai/models/video_create_error.rbi | 26 + rbi/openai/models/video_create_params.rbi | 87 +++ rbi/openai/models/video_delete_params.rbi | 27 + rbi/openai/models/video_delete_response.rbi | 46 ++ .../models/video_download_content_params.rbi | 89 +++ rbi/openai/models/video_list_params.rbi | 91 +++ rbi/openai/models/video_model.rbi | 19 + rbi/openai/models/video_remix_params.rbi | 40 ++ rbi/openai/models/video_retrieve_params.rbi | 27 + rbi/openai/models/video_seconds.rbi | 20 + rbi/openai/models/video_size.rbi | 23 + rbi/openai/resources/beta.rbi | 3 + rbi/openai/resources/beta/chatkit.rbi | 35 ++ .../resources/beta/chatkit/sessions.rbi | 61 ++ rbi/openai/resources/beta/chatkit/threads.rbi | 110 ++++ rbi/openai/resources/images.rbi | 6 +- rbi/openai/resources/videos.rbi | 121 ++++ scripts/detect-breaking-changes | 4 + sig/openai/client.rbs | 2 + sig/openai/models.rbs | 22 + sig/openai/models/all_models.rbs | 4 + .../models/beta/chatkit/chat_session.rbs | 69 ++ .../chat_session_automatic_thread_titling.rbs | 17 + .../chat_session_chatkit_configuration.rbs | 34 + ...at_session_chatkit_configuration_param.rbs | 103 +++ .../chat_session_expires_after_param.rbs | 20 + .../beta/chatkit/chat_session_file_upload.rbs | 30 + .../beta/chatkit/chat_session_history.rbs | 19 + .../beta/chatkit/chat_session_rate_limits.rbs | 18 + .../chat_session_rate_limits_param.rbs | 20 + .../beta/chatkit/chat_session_status.rbs | 19 + .../chatkit/chat_session_workflow_param.rbs | 69 ++ .../beta/chatkit/chatkit_attachment.rbs | 57 ++ .../chatkit/chatkit_response_output_text.rbs | 114 ++++ .../models/beta/chatkit/chatkit_thread.rbs | 96 +++ .../chatkit_thread_assistant_message_item.rbs | 51 ++ .../beta/chatkit/chatkit_thread_item_list.rbs | 276 ++++++++ .../chatkit_thread_user_message_item.rbs | 127 ++++ .../beta/chatkit/chatkit_widget_item.rbs | 51 ++ .../beta/chatkit/session_cancel_params.rbs | 19 + .../beta/chatkit/session_create_params.rbs | 62 ++ .../beta/chatkit/thread_delete_params.rbs | 19 + .../beta/chatkit/thread_delete_response.rbs | 30 + .../beta/chatkit/thread_list_items_params.rbs | 66 ++ .../beta/chatkit/thread_list_params.rbs | 73 +++ .../beta/chatkit/thread_retrieve_params.rbs | 19 + .../beta/chatkit_upload_file_params.rbs | 26 + .../beta/chatkit_upload_file_response.rbs | 14 + sig/openai/models/beta/chatkit_workflow.rbs | 55 ++ sig/openai/models/beta/file_part.rbs | 42 ++ sig/openai/models/beta/image_part.rbs | 47 ++ sig/openai/models/image_model.rbs | 4 +- .../models/realtime/realtime_session.rbs | 8 + .../realtime_session_create_request.rbs | 8 + .../realtime_session_create_response.rbs | 8 + sig/openai/models/responses/tool.rbs | 3 +- sig/openai/models/responses_model.rbs | 4 + sig/openai/models/video.rbs | 88 +++ sig/openai/models/video_create_error.rbs | 15 + sig/openai/models/video_create_params.rbs | 58 ++ sig/openai/models/video_delete_params.rbs | 14 + sig/openai/models/video_delete_response.rbs | 22 + .../models/video_download_content_params.rbs | 40 ++ sig/openai/models/video_list_params.rbs | 55 ++ sig/openai/models/video_model.rbs | 14 + sig/openai/models/video_remix_params.rbs | 23 + sig/openai/models/video_retrieve_params.rbs | 15 + sig/openai/models/video_seconds.rbs | 15 + sig/openai/models/video_size.rbs | 16 + sig/openai/resources/beta.rbs | 2 + sig/openai/resources/beta/chatkit.rbs | 18 + .../resources/beta/chatkit/sessions.rbs | 25 + sig/openai/resources/beta/chatkit/threads.rbs | 39 ++ sig/openai/resources/videos.rbs | 45 ++ test/openai/resource_namespaces.rb | 6 + .../resources/beta/chatkit/sessions_test.rb | 51 ++ .../resources/beta/chatkit/threads_test.rb | 146 +++++ test/openai/resources/beta/chatkit_test.rb | 27 + test/openai/resources/videos_test.rb | 138 ++++ 180 files changed, 10385 insertions(+), 20 deletions(-) create mode 100644 lib/openai/models/beta/chatkit/chat_session.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_chatkit_configuration.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_expires_after_param.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_file_upload.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_history.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_rate_limits.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_rate_limits_param.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_status.rb create mode 100644 lib/openai/models/beta/chatkit/chat_session_workflow_param.rb create mode 100644 lib/openai/models/beta/chatkit/chatkit_attachment.rb create mode 100644 lib/openai/models/beta/chatkit/chatkit_response_output_text.rb create mode 100644 lib/openai/models/beta/chatkit/chatkit_thread.rb create mode 100644 lib/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rb create mode 100644 lib/openai/models/beta/chatkit/chatkit_thread_item_list.rb create mode 100644 lib/openai/models/beta/chatkit/chatkit_thread_user_message_item.rb create mode 100644 lib/openai/models/beta/chatkit/chatkit_widget_item.rb create mode 100644 lib/openai/models/beta/chatkit/session_cancel_params.rb create mode 100644 lib/openai/models/beta/chatkit/session_create_params.rb create mode 100644 lib/openai/models/beta/chatkit/thread_delete_params.rb create mode 100644 lib/openai/models/beta/chatkit/thread_delete_response.rb create mode 100644 lib/openai/models/beta/chatkit/thread_list_items_params.rb create mode 100644 lib/openai/models/beta/chatkit/thread_list_params.rb create mode 100644 lib/openai/models/beta/chatkit/thread_retrieve_params.rb create mode 100644 lib/openai/models/beta/chatkit_upload_file_params.rb create mode 100644 lib/openai/models/beta/chatkit_upload_file_response.rb create mode 100644 lib/openai/models/beta/chatkit_workflow.rb create mode 100644 lib/openai/models/beta/file_part.rb create mode 100644 lib/openai/models/beta/image_part.rb create mode 100644 lib/openai/models/video.rb create mode 100644 lib/openai/models/video_create_error.rb create mode 100644 lib/openai/models/video_create_params.rb create mode 100644 lib/openai/models/video_delete_params.rb create mode 100644 lib/openai/models/video_delete_response.rb create mode 100644 lib/openai/models/video_download_content_params.rb create mode 100644 lib/openai/models/video_list_params.rb create mode 100644 lib/openai/models/video_model.rb create mode 100644 lib/openai/models/video_remix_params.rb create mode 100644 lib/openai/models/video_retrieve_params.rb create mode 100644 lib/openai/models/video_seconds.rb create mode 100644 lib/openai/models/video_size.rb create mode 100644 lib/openai/resources/beta/chatkit.rb create mode 100644 lib/openai/resources/beta/chatkit/sessions.rb create mode 100644 lib/openai/resources/beta/chatkit/threads.rb create mode 100644 lib/openai/resources/videos.rb create mode 100644 rbi/openai/models/beta/chatkit/chat_session.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_expires_after_param.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_file_upload.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_history.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_rate_limits.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_rate_limits_param.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_status.rbi create mode 100644 rbi/openai/models/beta/chatkit/chat_session_workflow_param.rbi create mode 100644 rbi/openai/models/beta/chatkit/chatkit_attachment.rbi create mode 100644 rbi/openai/models/beta/chatkit/chatkit_response_output_text.rbi create mode 100644 rbi/openai/models/beta/chatkit/chatkit_thread.rbi create mode 100644 rbi/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbi create mode 100644 rbi/openai/models/beta/chatkit/chatkit_thread_item_list.rbi create mode 100644 rbi/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbi create mode 100644 rbi/openai/models/beta/chatkit/chatkit_widget_item.rbi create mode 100644 rbi/openai/models/beta/chatkit/session_cancel_params.rbi create mode 100644 rbi/openai/models/beta/chatkit/session_create_params.rbi create mode 100644 rbi/openai/models/beta/chatkit/thread_delete_params.rbi create mode 100644 rbi/openai/models/beta/chatkit/thread_delete_response.rbi create mode 100644 rbi/openai/models/beta/chatkit/thread_list_items_params.rbi create mode 100644 rbi/openai/models/beta/chatkit/thread_list_params.rbi create mode 100644 rbi/openai/models/beta/chatkit/thread_retrieve_params.rbi create mode 100644 rbi/openai/models/beta/chatkit_upload_file_params.rbi create mode 100644 rbi/openai/models/beta/chatkit_upload_file_response.rbi create mode 100644 rbi/openai/models/beta/chatkit_workflow.rbi create mode 100644 rbi/openai/models/beta/file_part.rbi create mode 100644 rbi/openai/models/beta/image_part.rbi create mode 100644 rbi/openai/models/video.rbi create mode 100644 rbi/openai/models/video_create_error.rbi create mode 100644 rbi/openai/models/video_create_params.rbi create mode 100644 rbi/openai/models/video_delete_params.rbi create mode 100644 rbi/openai/models/video_delete_response.rbi create mode 100644 rbi/openai/models/video_download_content_params.rbi create mode 100644 rbi/openai/models/video_list_params.rbi create mode 100644 rbi/openai/models/video_model.rbi create mode 100644 rbi/openai/models/video_remix_params.rbi create mode 100644 rbi/openai/models/video_retrieve_params.rbi create mode 100644 rbi/openai/models/video_seconds.rbi create mode 100644 rbi/openai/models/video_size.rbi create mode 100644 rbi/openai/resources/beta/chatkit.rbi create mode 100644 rbi/openai/resources/beta/chatkit/sessions.rbi create mode 100644 rbi/openai/resources/beta/chatkit/threads.rbi create mode 100644 rbi/openai/resources/videos.rbi create mode 100644 sig/openai/models/beta/chatkit/chat_session.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_expires_after_param.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_file_upload.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_history.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_rate_limits.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_rate_limits_param.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_status.rbs create mode 100644 sig/openai/models/beta/chatkit/chat_session_workflow_param.rbs create mode 100644 sig/openai/models/beta/chatkit/chatkit_attachment.rbs create mode 100644 sig/openai/models/beta/chatkit/chatkit_response_output_text.rbs create mode 100644 sig/openai/models/beta/chatkit/chatkit_thread.rbs create mode 100644 sig/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbs create mode 100644 sig/openai/models/beta/chatkit/chatkit_thread_item_list.rbs create mode 100644 sig/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbs create mode 100644 sig/openai/models/beta/chatkit/chatkit_widget_item.rbs create mode 100644 sig/openai/models/beta/chatkit/session_cancel_params.rbs create mode 100644 sig/openai/models/beta/chatkit/session_create_params.rbs create mode 100644 sig/openai/models/beta/chatkit/thread_delete_params.rbs create mode 100644 sig/openai/models/beta/chatkit/thread_delete_response.rbs create mode 100644 sig/openai/models/beta/chatkit/thread_list_items_params.rbs create mode 100644 sig/openai/models/beta/chatkit/thread_list_params.rbs create mode 100644 sig/openai/models/beta/chatkit/thread_retrieve_params.rbs create mode 100644 sig/openai/models/beta/chatkit_upload_file_params.rbs create mode 100644 sig/openai/models/beta/chatkit_upload_file_response.rbs create mode 100644 sig/openai/models/beta/chatkit_workflow.rbs create mode 100644 sig/openai/models/beta/file_part.rbs create mode 100644 sig/openai/models/beta/image_part.rbs create mode 100644 sig/openai/models/video.rbs create mode 100644 sig/openai/models/video_create_error.rbs create mode 100644 sig/openai/models/video_create_params.rbs create mode 100644 sig/openai/models/video_delete_params.rbs create mode 100644 sig/openai/models/video_delete_response.rbs create mode 100644 sig/openai/models/video_download_content_params.rbs create mode 100644 sig/openai/models/video_list_params.rbs create mode 100644 sig/openai/models/video_model.rbs create mode 100644 sig/openai/models/video_remix_params.rbs create mode 100644 sig/openai/models/video_retrieve_params.rbs create mode 100644 sig/openai/models/video_seconds.rbs create mode 100644 sig/openai/models/video_size.rbs create mode 100644 sig/openai/resources/beta/chatkit.rbs create mode 100644 sig/openai/resources/beta/chatkit/sessions.rbs create mode 100644 sig/openai/resources/beta/chatkit/threads.rbs create mode 100644 sig/openai/resources/videos.rbs create mode 100644 test/openai/resources/beta/chatkit/sessions_test.rb create mode 100644 test/openai/resources/beta/chatkit/threads_test.rb create mode 100644 test/openai/resources/beta/chatkit_test.rb create mode 100644 test/openai/resources/videos_test.rb diff --git a/.stats.yml b/.stats.yml index 4e40d470..f7aa916f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 122 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fadefdc7c7e30df47c09df323669b242ff90ee08e51f304175ace5274e0aab49.yml -openapi_spec_hash: 6d20f639d9ff8a097a34962da6218231 -config_hash: 902654e60f5d659f2bfcfd903e17c46d +configured_endpoints: 135 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-d64cf80d2ebddf175c5578f68226a3d5bbd3f7fd8d62ccac2205f3fc05a355ee.yml +openapi_spec_hash: d51e0d60d0c536f210b597a211bc5af0 +config_hash: e7c42016df9c6bd7bd6ff15101b9bc9b diff --git a/lib/openai.rb b/lib/openai.rb index d2f7fa8c..657cacd8 100644 --- a/lib/openai.rb +++ b/lib/openai.rb @@ -114,9 +114,39 @@ require_relative "openai/models/beta/assistant_tool_choice_function" require_relative "openai/models/beta/assistant_tool_choice_option" require_relative "openai/models/beta/assistant_update_params" +require_relative "openai/models/beta/chatkit/chatkit_attachment" +require_relative "openai/models/beta/chatkit/chatkit_response_output_text" +require_relative "openai/models/beta/chatkit/chatkit_thread" +require_relative "openai/models/beta/chatkit/chatkit_thread_assistant_message_item" +require_relative "openai/models/beta/chatkit/chatkit_thread_item_list" +require_relative "openai/models/beta/chatkit/chatkit_thread_user_message_item" +require_relative "openai/models/beta/chatkit/chatkit_widget_item" +require_relative "openai/models/beta/chatkit/chat_session" +require_relative "openai/models/beta/chatkit/chat_session_automatic_thread_titling" +require_relative "openai/models/beta/chatkit/chat_session_chatkit_configuration" +require_relative "openai/models/beta/chatkit/chat_session_chatkit_configuration_param" +require_relative "openai/models/beta/chatkit/chat_session_expires_after_param" +require_relative "openai/models/beta/chatkit/chat_session_file_upload" +require_relative "openai/models/beta/chatkit/chat_session_history" +require_relative "openai/models/beta/chatkit/chat_session_rate_limits" +require_relative "openai/models/beta/chatkit/chat_session_rate_limits_param" +require_relative "openai/models/beta/chatkit/chat_session_status" +require_relative "openai/models/beta/chatkit/chat_session_workflow_param" +require_relative "openai/models/beta/chatkit/session_cancel_params" +require_relative "openai/models/beta/chatkit/session_create_params" +require_relative "openai/models/beta/chatkit/thread_delete_params" +require_relative "openai/models/beta/chatkit/thread_delete_response" +require_relative "openai/models/beta/chatkit/thread_list_items_params" +require_relative "openai/models/beta/chatkit/thread_list_params" +require_relative "openai/models/beta/chatkit/thread_retrieve_params" +require_relative "openai/models/beta/chatkit_upload_file_params" +require_relative "openai/models/beta/chatkit_upload_file_response" +require_relative "openai/models/beta/chatkit_workflow" require_relative "openai/models/beta/code_interpreter_tool" +require_relative "openai/models/beta/file_part" require_relative "openai/models/beta/file_search_tool" require_relative "openai/models/beta/function_tool" +require_relative "openai/models/beta/image_part" require_relative "openai/models/beta/message_stream_event" require_relative "openai/models/beta/run_step_stream_event" require_relative "openai/models/beta/run_stream_event" @@ -642,6 +672,18 @@ require_relative "openai/models/vector_store_search_params" require_relative "openai/models/vector_store_search_response" require_relative "openai/models/vector_store_update_params" +require_relative "openai/models/video" +require_relative "openai/models/video_create_error" +require_relative "openai/models/video_create_params" +require_relative "openai/models/video_delete_params" +require_relative "openai/models/video_delete_response" +require_relative "openai/models/video_download_content_params" +require_relative "openai/models/video_list_params" +require_relative "openai/models/video_model" +require_relative "openai/models/video_remix_params" +require_relative "openai/models/video_retrieve_params" +require_relative "openai/models/video_seconds" +require_relative "openai/models/video_size" require_relative "openai/models/webhooks/batch_cancelled_webhook_event" require_relative "openai/models/webhooks/batch_completed_webhook_event" require_relative "openai/models/webhooks/batch_expired_webhook_event" @@ -667,6 +709,9 @@ require_relative "openai/resources/batches" require_relative "openai/resources/beta" require_relative "openai/resources/beta/assistants" +require_relative "openai/resources/beta/chatkit" +require_relative "openai/resources/beta/chatkit/sessions" +require_relative "openai/resources/beta/chatkit/threads" require_relative "openai/resources/beta/threads" require_relative "openai/resources/beta/threads/messages" require_relative "openai/resources/beta/threads/runs" @@ -708,6 +753,7 @@ require_relative "openai/resources/vector_stores" require_relative "openai/resources/vector_stores/file_batches" require_relative "openai/resources/vector_stores/files" +require_relative "openai/resources/videos" require_relative "openai/resources/webhooks" require_relative "openai/helpers/streaming/response_events" require_relative "openai/helpers/streaming/response_stream" diff --git a/lib/openai/client.rb b/lib/openai/client.rb index 67b0e14b..0a5d55b8 100644 --- a/lib/openai/client.rb +++ b/lib/openai/client.rb @@ -87,6 +87,9 @@ class Client < OpenAI::Internal::Transport::BaseClient # @return [OpenAI::Resources::Containers] attr_reader :containers + # @return [OpenAI::Resources::Videos] + attr_reader :videos + # @api private # # @return [Hash{String=>String}] @@ -170,6 +173,7 @@ def initialize( @conversations = OpenAI::Resources::Conversations.new(client: self) @evals = OpenAI::Resources::Evals.new(client: self) @containers = OpenAI::Resources::Containers.new(client: self) + @videos = OpenAI::Resources::Videos.new(client: self) end end end diff --git a/lib/openai/internal/conversation_cursor_page.rb b/lib/openai/internal/conversation_cursor_page.rb index c62a4eff..0e781b31 100644 --- a/lib/openai/internal/conversation_cursor_page.rb +++ b/lib/openai/internal/conversation_cursor_page.rb @@ -10,8 +10,8 @@ module Internal # end # # @example - # conversation_cursor_page.auto_paging_each do |item| - # puts(item) + # conversation_cursor_page.auto_paging_each do |thread| + # puts(thread) # end class ConversationCursorPage include OpenAI::Internal::Type::BasePage diff --git a/lib/openai/models.rb b/lib/openai/models.rb index f03180d9..98f82111 100644 --- a/lib/openai/models.rb +++ b/lib/openai/models.rb @@ -259,5 +259,27 @@ module OpenAI VectorStoreUpdateParams = OpenAI::Models::VectorStoreUpdateParams + Video = OpenAI::Models::Video + + VideoCreateError = OpenAI::Models::VideoCreateError + + VideoCreateParams = OpenAI::Models::VideoCreateParams + + VideoDeleteParams = OpenAI::Models::VideoDeleteParams + + VideoDownloadContentParams = OpenAI::Models::VideoDownloadContentParams + + VideoListParams = OpenAI::Models::VideoListParams + + VideoModel = OpenAI::Models::VideoModel + + VideoRemixParams = OpenAI::Models::VideoRemixParams + + VideoRetrieveParams = OpenAI::Models::VideoRetrieveParams + + VideoSeconds = OpenAI::Models::VideoSeconds + + VideoSize = OpenAI::Models::VideoSize + Webhooks = OpenAI::Models::Webhooks end diff --git a/lib/openai/models/all_models.rb b/lib/openai/models/all_models.rb index f9a35a24..0d8138b3 100644 --- a/lib/openai/models/all_models.rb +++ b/lib/openai/models/all_models.rb @@ -25,6 +25,8 @@ module ResponsesOnlyModel COMPUTER_USE_PREVIEW = :"computer-use-preview" COMPUTER_USE_PREVIEW_2025_03_11 = :"computer-use-preview-2025-03-11" GPT_5_CODEX = :"gpt-5-codex" + GPT_5_PRO = :"gpt-5-pro" + GPT_5_PRO_2025_10_06 = :"gpt-5-pro-2025-10-06" # @!method self.values # @return [Array] diff --git a/lib/openai/models/beta/chatkit/chat_session.rb b/lib/openai/models/beta/chatkit/chat_session.rb new file mode 100644 index 00000000..d4e992de --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSession < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier for the ChatKit session. + # + # @return [String] + required :id, String + + # @!attribute chatkit_configuration + # Resolved ChatKit feature configuration for the session. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfiguration] + required :chatkit_configuration, -> { OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration } + + # @!attribute client_secret + # Ephemeral client secret that authenticates session requests. + # + # @return [String] + required :client_secret, String + + # @!attribute expires_at + # Unix timestamp (in seconds) for when the session expires. + # + # @return [Integer] + required :expires_at, Integer + + # @!attribute max_requests_per_1_minute + # Convenience copy of the per-minute request limit. + # + # @return [Integer] + required :max_requests_per_1_minute, Integer + + # @!attribute object + # Type discriminator that is always `chatkit.session`. + # + # @return [Symbol, :"chatkit.session"] + required :object, const: :"chatkit.session" + + # @!attribute rate_limits + # Resolved rate limit values. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionRateLimits] + required :rate_limits, -> { OpenAI::Beta::ChatKit::ChatSessionRateLimits } + + # @!attribute status + # Current lifecycle state of the session. + # + # @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatSessionStatus] + required :status, enum: -> { OpenAI::Beta::ChatKit::ChatSessionStatus } + + # @!attribute user + # User identifier associated with the session. + # + # @return [String] + required :user, String + + # @!attribute workflow + # Workflow metadata for the session. + # + # @return [OpenAI::Models::Beta::ChatKitWorkflow] + required :workflow, -> { OpenAI::Beta::ChatKitWorkflow } + + # @!method initialize(id:, chatkit_configuration:, client_secret:, expires_at:, max_requests_per_1_minute:, rate_limits:, status:, user:, workflow:, object: :"chatkit.session") + # Represents a ChatKit session and its resolved configuration. + # + # @param id [String] Identifier for the ChatKit session. + # + # @param chatkit_configuration [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfiguration] Resolved ChatKit feature configuration for the session. + # + # @param client_secret [String] Ephemeral client secret that authenticates session requests. + # + # @param expires_at [Integer] Unix timestamp (in seconds) for when the session expires. + # + # @param max_requests_per_1_minute [Integer] Convenience copy of the per-minute request limit. + # + # @param rate_limits [OpenAI::Models::Beta::ChatKit::ChatSessionRateLimits] Resolved rate limit values. + # + # @param status [Symbol, OpenAI::Models::Beta::ChatKit::ChatSessionStatus] Current lifecycle state of the session. + # + # @param user [String] User identifier associated with the session. + # + # @param workflow [OpenAI::Models::Beta::ChatKitWorkflow] Workflow metadata for the session. + # + # @param object [Symbol, :"chatkit.session"] Type discriminator that is always `chatkit.session`. + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rb b/lib/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rb new file mode 100644 index 00000000..4fab5d6e --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionAutomaticThreadTitling < OpenAI::Internal::Type::BaseModel + # @!attribute enabled + # Whether automatic thread titling is enabled. + # + # @return [Boolean] + required :enabled, OpenAI::Internal::Type::Boolean + + # @!method initialize(enabled:) + # Automatic thread title preferences for the session. + # + # @param enabled [Boolean] Whether automatic thread titling is enabled. + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration.rb b/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration.rb new file mode 100644 index 00000000..cad3b35a --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionChatKitConfiguration < OpenAI::Internal::Type::BaseModel + # @!attribute automatic_thread_titling + # Automatic thread titling preferences. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionAutomaticThreadTitling] + required :automatic_thread_titling, -> { OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling } + + # @!attribute file_upload + # Upload settings for the session. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionFileUpload] + required :file_upload, -> { OpenAI::Beta::ChatKit::ChatSessionFileUpload } + + # @!attribute history + # History retention configuration. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionHistory] + required :history, -> { OpenAI::Beta::ChatKit::ChatSessionHistory } + + # @!method initialize(automatic_thread_titling:, file_upload:, history:) + # ChatKit configuration for the session. + # + # @param automatic_thread_titling [OpenAI::Models::Beta::ChatKit::ChatSessionAutomaticThreadTitling] Automatic thread titling preferences. + # + # @param file_upload [OpenAI::Models::Beta::ChatKit::ChatSessionFileUpload] Upload settings for the session. + # + # @param history [OpenAI::Models::Beta::ChatKit::ChatSessionHistory] History retention configuration. + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rb b/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rb new file mode 100644 index 00000000..f7c096c1 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionChatKitConfigurationParam < OpenAI::Internal::Type::BaseModel + # @!attribute automatic_thread_titling + # Configuration for automatic thread titling. When omitted, automatic thread + # titling is enabled by default. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling, nil] + optional :automatic_thread_titling, + -> { OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling } + + # @!attribute file_upload + # Configuration for upload enablement and limits. When omitted, uploads are + # disabled by default (max_files 10, max_file_size 512 MB). + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload, nil] + optional :file_upload, -> { OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload } + + # @!attribute history + # Configuration for chat history retention. When omitted, history is enabled by + # default with no limit on recent_threads (null). + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History, nil] + optional :history, -> { OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History } + + # @!method initialize(automatic_thread_titling: nil, file_upload: nil, history: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam} for more + # details. + # + # Optional per-session configuration settings for ChatKit behavior. + # + # @param automatic_thread_titling [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling] Configuration for automatic thread titling. When omitted, automatic thread titli + # + # @param file_upload [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload] Configuration for upload enablement and limits. When omitted, uploads are disabl + # + # @param history [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History] Configuration for chat history retention. When omitted, history is enabled by de + + # @see OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam#automatic_thread_titling + class AutomaticThreadTitling < OpenAI::Internal::Type::BaseModel + # @!attribute enabled + # Enable automatic thread title generation. Defaults to true. + # + # @return [Boolean, nil] + optional :enabled, OpenAI::Internal::Type::Boolean + + # @!method initialize(enabled: nil) + # Configuration for automatic thread titling. When omitted, automatic thread + # titling is enabled by default. + # + # @param enabled [Boolean] Enable automatic thread title generation. Defaults to true. + end + + # @see OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam#file_upload + class FileUpload < OpenAI::Internal::Type::BaseModel + # @!attribute enabled + # Enable uploads for this session. Defaults to false. + # + # @return [Boolean, nil] + optional :enabled, OpenAI::Internal::Type::Boolean + + # @!attribute max_file_size + # Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is + # the maximum allowable size. + # + # @return [Integer, nil] + optional :max_file_size, Integer + + # @!attribute max_files + # Maximum number of files that can be uploaded to the session. Defaults to 10. + # + # @return [Integer, nil] + optional :max_files, Integer + + # @!method initialize(enabled: nil, max_file_size: nil, max_files: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload} + # for more details. + # + # Configuration for upload enablement and limits. When omitted, uploads are + # disabled by default (max_files 10, max_file_size 512 MB). + # + # @param enabled [Boolean] Enable uploads for this session. Defaults to false. + # + # @param max_file_size [Integer] Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is t + # + # @param max_files [Integer] Maximum number of files that can be uploaded to the session. Defaults to 10. + end + + # @see OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam#history + class History < OpenAI::Internal::Type::BaseModel + # @!attribute enabled + # Enables chat users to access previous ChatKit threads. Defaults to true. + # + # @return [Boolean, nil] + optional :enabled, OpenAI::Internal::Type::Boolean + + # @!attribute recent_threads + # Number of recent ChatKit threads users have access to. Defaults to unlimited + # when unset. + # + # @return [Integer, nil] + optional :recent_threads, Integer + + # @!method initialize(enabled: nil, recent_threads: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History} + # for more details. + # + # Configuration for chat history retention. When omitted, history is enabled by + # default with no limit on recent_threads (null). + # + # @param enabled [Boolean] Enables chat users to access previous ChatKit threads. Defaults to true. + # + # @param recent_threads [Integer] Number of recent ChatKit threads users have access to. Defaults to unlimited whe + end + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_expires_after_param.rb b/lib/openai/models/beta/chatkit/chat_session_expires_after_param.rb new file mode 100644 index 00000000..071b3ae4 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_expires_after_param.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionExpiresAfterParam < OpenAI::Internal::Type::BaseModel + # @!attribute anchor + # Base timestamp used to calculate expiration. Currently fixed to `created_at`. + # + # @return [Symbol, :created_at] + required :anchor, const: :created_at + + # @!attribute seconds + # Number of seconds after the anchor when the session expires. + # + # @return [Integer] + required :seconds, Integer + + # @!method initialize(seconds:, anchor: :created_at) + # Controls when the session expires relative to an anchor timestamp. + # + # @param seconds [Integer] Number of seconds after the anchor when the session expires. + # + # @param anchor [Symbol, :created_at] Base timestamp used to calculate expiration. Currently fixed to `created_at`. + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_file_upload.rb b/lib/openai/models/beta/chatkit/chat_session_file_upload.rb new file mode 100644 index 00000000..2eb1db79 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_file_upload.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionFileUpload < OpenAI::Internal::Type::BaseModel + # @!attribute enabled + # Indicates if uploads are enabled for the session. + # + # @return [Boolean] + required :enabled, OpenAI::Internal::Type::Boolean + + # @!attribute max_file_size + # Maximum upload size in megabytes. + # + # @return [Integer, nil] + required :max_file_size, Integer, nil?: true + + # @!attribute max_files + # Maximum number of uploads allowed during the session. + # + # @return [Integer, nil] + required :max_files, Integer, nil?: true + + # @!method initialize(enabled:, max_file_size:, max_files:) + # Upload permissions and limits applied to the session. + # + # @param enabled [Boolean] Indicates if uploads are enabled for the session. + # + # @param max_file_size [Integer, nil] Maximum upload size in megabytes. + # + # @param max_files [Integer, nil] Maximum number of uploads allowed during the session. + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_history.rb b/lib/openai/models/beta/chatkit/chat_session_history.rb new file mode 100644 index 00000000..8defcd7e --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_history.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionHistory < OpenAI::Internal::Type::BaseModel + # @!attribute enabled + # Indicates if chat history is persisted for the session. + # + # @return [Boolean] + required :enabled, OpenAI::Internal::Type::Boolean + + # @!attribute recent_threads + # Number of prior threads surfaced in history views. Defaults to null when all + # history is retained. + # + # @return [Integer, nil] + required :recent_threads, Integer, nil?: true + + # @!method initialize(enabled:, recent_threads:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatSessionHistory} for more details. + # + # History retention preferences returned for the session. + # + # @param enabled [Boolean] Indicates if chat history is persisted for the session. + # + # @param recent_threads [Integer, nil] Number of prior threads surfaced in history views. Defaults to null when all his + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_rate_limits.rb b/lib/openai/models/beta/chatkit/chat_session_rate_limits.rb new file mode 100644 index 00000000..79e9a97b --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_rate_limits.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionRateLimits < OpenAI::Internal::Type::BaseModel + # @!attribute max_requests_per_1_minute + # Maximum allowed requests per one-minute window. + # + # @return [Integer] + required :max_requests_per_1_minute, Integer + + # @!method initialize(max_requests_per_1_minute:) + # Active per-minute request limit for the session. + # + # @param max_requests_per_1_minute [Integer] Maximum allowed requests per one-minute window. + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_rate_limits_param.rb b/lib/openai/models/beta/chatkit/chat_session_rate_limits_param.rb new file mode 100644 index 00000000..4f889e5a --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_rate_limits_param.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionRateLimitsParam < OpenAI::Internal::Type::BaseModel + # @!attribute max_requests_per_1_minute + # Maximum number of requests allowed per minute for the session. Defaults to 10. + # + # @return [Integer, nil] + optional :max_requests_per_1_minute, Integer + + # @!method initialize(max_requests_per_1_minute: nil) + # Controls request rate limits for the session. + # + # @param max_requests_per_1_minute [Integer] Maximum number of requests allowed per minute for the session. Defaults to 10. + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_status.rb b/lib/openai/models/beta/chatkit/chat_session_status.rb new file mode 100644 index 00000000..4939e568 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_status.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + module ChatSessionStatus + extend OpenAI::Internal::Type::Enum + + ACTIVE = :active + EXPIRED = :expired + CANCELLED = :cancelled + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chat_session_workflow_param.rb b/lib/openai/models/beta/chatkit/chat_session_workflow_param.rb new file mode 100644 index 00000000..b2bf5c55 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chat_session_workflow_param.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionWorkflowParam < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier for the workflow invoked by the session. + # + # @return [String] + required :id, String + + # @!attribute state_variables + # State variables forwarded to the workflow. Keys may be up to 64 characters, + # values must be primitive types, and the map defaults to an empty object. + # + # @return [Hash{Symbol=>String, Boolean, Float}, nil] + optional :state_variables, + -> { OpenAI::Internal::Type::HashOf[union: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::StateVariable] } + + # @!attribute tracing + # Optional tracing overrides for the workflow invocation. When omitted, tracing is + # enabled by default. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::Tracing, nil] + optional :tracing, -> { OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing } + + # @!attribute version + # Specific workflow version to run. Defaults to the latest deployed version. + # + # @return [String, nil] + optional :version, String + + # @!method initialize(id:, state_variables: nil, tracing: nil, version: nil) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam} for more details. + # + # Workflow reference and overrides applied to the chat session. + # + # @param id [String] Identifier for the workflow invoked by the session. + # + # @param state_variables [Hash{Symbol=>String, Boolean, Float}] State variables forwarded to the workflow. Keys may be up to 64 characters, valu + # + # @param tracing [OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::Tracing] Optional tracing overrides for the workflow invocation. When omitted, tracing is + # + # @param version [String] Specific workflow version to run. Defaults to the latest deployed version. + + module StateVariable + extend OpenAI::Internal::Type::Union + + variant String + + variant OpenAI::Internal::Type::Boolean + + variant Float + + # @!method self.variants + # @return [Array(String, Boolean, Float)] + end + + # @see OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam#tracing + class Tracing < OpenAI::Internal::Type::BaseModel + # @!attribute enabled + # Whether tracing is enabled during the session. Defaults to true. + # + # @return [Boolean, nil] + optional :enabled, OpenAI::Internal::Type::Boolean + + # @!method initialize(enabled: nil) + # Optional tracing overrides for the workflow invocation. When omitted, tracing is + # enabled by default. + # + # @param enabled [Boolean] Whether tracing is enabled during the session. Defaults to true. + end + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/chatkit_attachment.rb b/lib/openai/models/beta/chatkit/chatkit_attachment.rb new file mode 100644 index 00000000..f8c1fee0 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chatkit_attachment.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatKitAttachment < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier for the attachment. + # + # @return [String] + required :id, String + + # @!attribute mime_type + # MIME type of the attachment. + # + # @return [String] + required :mime_type, String + + # @!attribute name + # Original display name for the attachment. + # + # @return [String] + required :name, String + + # @!attribute preview_url + # Preview URL for rendering the attachment inline. + # + # @return [String, nil] + required :preview_url, String, nil?: true + + # @!attribute type + # Attachment discriminator. + # + # @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitAttachment::Type] + required :type, enum: -> { OpenAI::Beta::ChatKit::ChatKitAttachment::Type } + + # @!method initialize(id:, mime_type:, name:, preview_url:, type:) + # Attachment metadata included on thread items. + # + # @param id [String] Identifier for the attachment. + # + # @param mime_type [String] MIME type of the attachment. + # + # @param name [String] Original display name for the attachment. + # + # @param preview_url [String, nil] Preview URL for rendering the attachment inline. + # + # @param type [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitAttachment::Type] Attachment discriminator. + + # Attachment discriminator. + # + # @see OpenAI::Models::Beta::ChatKit::ChatKitAttachment#type + module Type + extend OpenAI::Internal::Type::Enum + + IMAGE = :image + FILE = :file + + # @!method self.values + # @return [Array] + end + end + end + + ChatKitAttachment = ChatKit::ChatKitAttachment + end + end +end diff --git a/lib/openai/models/beta/chatkit/chatkit_response_output_text.rb b/lib/openai/models/beta/chatkit/chatkit_response_output_text.rb new file mode 100644 index 00000000..80235f50 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chatkit_response_output_text.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatKitResponseOutputText < OpenAI::Internal::Type::BaseModel + # @!attribute annotations + # Ordered list of annotations attached to the response text. + # + # @return [Array] + required :annotations, + -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation] } + + # @!attribute text + # Assistant generated text. + # + # @return [String] + required :text, String + + # @!attribute type + # Type discriminator that is always `output_text`. + # + # @return [Symbol, :output_text] + required :type, const: :output_text + + # @!method initialize(annotations:, text:, type: :output_text) + # Assistant response text accompanied by optional annotations. + # + # @param annotations [Array] Ordered list of annotations attached to the response text. + # + # @param text [String] Assistant generated text. + # + # @param type [Symbol, :output_text] Type discriminator that is always `output_text`. + + # Annotation object describing a cited source. + module Annotation + extend OpenAI::Internal::Type::Union + + discriminator :type + + # Annotation that references an uploaded file. + variant :file, -> { OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File } + + # Annotation that references a URL. + variant :url, -> { OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL } + + class File < OpenAI::Internal::Type::BaseModel + # @!attribute source + # File attachment referenced by the annotation. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source] + required :source, -> { OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source } + + # @!attribute type + # Type discriminator that is always `file` for this annotation. + # + # @return [Symbol, :file] + required :type, const: :file + + # @!method initialize(source:, type: :file) + # Annotation that references an uploaded file. + # + # @param source [OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source] File attachment referenced by the annotation. + # + # @param type [Symbol, :file] Type discriminator that is always `file` for this annotation. + + # @see OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File#source + class Source < OpenAI::Internal::Type::BaseModel + # @!attribute filename + # Filename referenced by the annotation. + # + # @return [String] + required :filename, String + + # @!attribute type + # Type discriminator that is always `file`. + # + # @return [Symbol, :file] + required :type, const: :file + + # @!method initialize(filename:, type: :file) + # File attachment referenced by the annotation. + # + # @param filename [String] Filename referenced by the annotation. + # + # @param type [Symbol, :file] Type discriminator that is always `file`. + end + end + + class URL < OpenAI::Internal::Type::BaseModel + # @!attribute source + # URL referenced by the annotation. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source] + required :source, -> { OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source } + + # @!attribute type + # Type discriminator that is always `url` for this annotation. + # + # @return [Symbol, :url] + required :type, const: :url + + # @!method initialize(source:, type: :url) + # Annotation that references a URL. + # + # @param source [OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source] URL referenced by the annotation. + # + # @param type [Symbol, :url] Type discriminator that is always `url` for this annotation. + + # @see OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL#source + class Source < OpenAI::Internal::Type::BaseModel + # @!attribute type + # Type discriminator that is always `url`. + # + # @return [Symbol, :url] + required :type, const: :url + + # @!attribute url + # URL referenced by the annotation. + # + # @return [String] + required :url, String + + # @!method initialize(url:, type: :url) + # URL referenced by the annotation. + # + # @param url [String] URL referenced by the annotation. + # + # @param type [Symbol, :url] Type discriminator that is always `url`. + end + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File, OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL)] + end + end + end + + ChatKitResponseOutputText = ChatKit::ChatKitResponseOutputText + end + end +end diff --git a/lib/openai/models/beta/chatkit/chatkit_thread.rb b/lib/openai/models/beta/chatkit/chatkit_thread.rb new file mode 100644 index 00000000..2643f559 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chatkit_thread.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + # @see OpenAI::Resources::Beta::ChatKit::Threads#retrieve + class ChatKitThread < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the thread. + # + # @return [String] + required :id, String + + # @!attribute created_at + # Unix timestamp (in seconds) for when the thread was created. + # + # @return [Integer] + required :created_at, Integer + + # @!attribute object + # Type discriminator that is always `chatkit.thread`. + # + # @return [Symbol, :"chatkit.thread"] + required :object, const: :"chatkit.thread" + + # @!attribute status + # Current status for the thread. Defaults to `active` for newly created threads. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Active, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Locked, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Closed] + required :status, union: -> { OpenAI::Beta::ChatKit::ChatKitThread::Status } + + # @!attribute title + # Optional human-readable title for the thread. Defaults to null when no title has + # been generated. + # + # @return [String, nil] + required :title, String, nil?: true + + # @!attribute user + # Free-form string that identifies your end user who owns the thread. + # + # @return [String] + required :user, String + + # @!method initialize(id:, created_at:, status:, title:, user:, object: :"chatkit.thread") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatKitThread} for more details. + # + # Represents a ChatKit thread and its current status. + # + # @param id [String] Identifier of the thread. + # + # @param created_at [Integer] Unix timestamp (in seconds) for when the thread was created. + # + # @param status [OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Active, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Locked, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Closed] Current status for the thread. Defaults to `active` for newly created threads. + # + # @param title [String, nil] Optional human-readable title for the thread. Defaults to null when no title has + # + # @param user [String] Free-form string that identifies your end user who owns the thread. + # + # @param object [Symbol, :"chatkit.thread"] Type discriminator that is always `chatkit.thread`. + + # Current status for the thread. Defaults to `active` for newly created threads. + # + # @see OpenAI::Models::Beta::ChatKit::ChatKitThread#status + module Status + extend OpenAI::Internal::Type::Union + + discriminator :type + + # Indicates that a thread is active. + variant :active, -> { OpenAI::Beta::ChatKit::ChatKitThread::Status::Active } + + # Indicates that a thread is locked and cannot accept new input. + variant :locked, -> { OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked } + + # Indicates that a thread has been closed. + variant :closed, -> { OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed } + + class Active < OpenAI::Internal::Type::BaseModel + # @!attribute type + # Status discriminator that is always `active`. + # + # @return [Symbol, :active] + required :type, const: :active + + # @!method initialize(type: :active) + # Indicates that a thread is active. + # + # @param type [Symbol, :active] Status discriminator that is always `active`. + end + + class Locked < OpenAI::Internal::Type::BaseModel + # @!attribute reason + # Reason that the thread was locked. Defaults to null when no reason is recorded. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute type + # Status discriminator that is always `locked`. + # + # @return [Symbol, :locked] + required :type, const: :locked + + # @!method initialize(reason:, type: :locked) + # Indicates that a thread is locked and cannot accept new input. + # + # @param reason [String, nil] Reason that the thread was locked. Defaults to null when no reason is recorded. + # + # @param type [Symbol, :locked] Status discriminator that is always `locked`. + end + + class Closed < OpenAI::Internal::Type::BaseModel + # @!attribute reason + # Reason that the thread was closed. Defaults to null when no reason is recorded. + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute type + # Status discriminator that is always `closed`. + # + # @return [Symbol, :closed] + required :type, const: :closed + + # @!method initialize(reason:, type: :closed) + # Indicates that a thread has been closed. + # + # @param reason [String, nil] Reason that the thread was closed. Defaults to null when no reason is recorded. + # + # @param type [Symbol, :closed] Status discriminator that is always `closed`. + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Active, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Locked, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Closed)] + end + end + end + + ChatKitThread = ChatKit::ChatKitThread + end + end +end diff --git a/lib/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rb b/lib/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rb new file mode 100644 index 00000000..1ce1b1a8 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatKitThreadAssistantMessageItem < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the thread item. + # + # @return [String] + required :id, String + + # @!attribute content + # Ordered assistant response segments. + # + # @return [Array] + required :content, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitResponseOutputText] } + + # @!attribute created_at + # Unix timestamp (in seconds) for when the item was created. + # + # @return [Integer] + required :created_at, Integer + + # @!attribute object + # Type discriminator that is always `chatkit.thread_item`. + # + # @return [Symbol, :"chatkit.thread_item"] + required :object, const: :"chatkit.thread_item" + + # @!attribute thread_id + # Identifier of the parent thread. + # + # @return [String] + required :thread_id, String + + # @!attribute type + # Type discriminator that is always `chatkit.assistant_message`. + # + # @return [Symbol, :"chatkit.assistant_message"] + required :type, const: :"chatkit.assistant_message" + + # @!method initialize(id:, content:, created_at:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.assistant_message") + # Assistant-authored message within a thread. + # + # @param id [String] Identifier of the thread item. + # + # @param content [Array] Ordered assistant response segments. + # + # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created. + # + # @param thread_id [String] Identifier of the parent thread. + # + # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`. + # + # @param type [Symbol, :"chatkit.assistant_message"] Type discriminator that is always `chatkit.assistant_message`. + end + end + + ChatKitThreadAssistantMessageItem = ChatKit::ChatKitThreadAssistantMessageItem + end + end +end diff --git a/lib/openai/models/beta/chatkit/chatkit_thread_item_list.rb b/lib/openai/models/beta/chatkit/chatkit_thread_item_list.rb new file mode 100644 index 00000000..f821e3f2 --- /dev/null +++ b/lib/openai/models/beta/chatkit/chatkit_thread_item_list.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatKitThreadItemList < OpenAI::Internal::Type::BaseModel + # @!attribute data + # A list of items + # + # @return [Array] + required :data, + -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data] } + + # @!attribute first_id + # The ID of the first item in the list. + # + # @return [String, nil] + required :first_id, String, nil?: true + + # @!attribute has_more + # Whether there are more items available. + # + # @return [Boolean] + required :has_more, OpenAI::Internal::Type::Boolean + + # @!attribute last_id + # The ID of the last item in the list. + # + # @return [String, nil] + required :last_id, String, nil?: true + + # @!attribute object + # The type of object returned, must be `list`. + # + # @return [Symbol, :list] + required :object, const: :list + + # @!method initialize(data:, first_id:, has_more:, last_id:, object: :list) + # A paginated list of thread items rendered for the ChatKit API. + # + # @param data [Array] A list of items + # + # @param first_id [String, nil] The ID of the first item in the list. + # + # @param has_more [Boolean] Whether there are more items available. + # + # @param last_id [String, nil] The ID of the last item in the list. + # + # @param object [Symbol, :list] The type of object returned, must be `list`. + + # User-authored messages within a thread. + module Data + extend OpenAI::Internal::Type::Union + + discriminator :type + + # User-authored messages within a thread. + variant :"chatkit.user_message", -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem } + + # Assistant-authored message within a thread. + variant :"chatkit.assistant_message", -> { OpenAI::Beta::ChatKit::ChatKitThreadAssistantMessageItem } + + # Thread item that renders a widget payload. + variant :"chatkit.widget", -> { OpenAI::Beta::ChatKit::ChatKitWidgetItem } + + # Record of a client side tool invocation initiated by the assistant. + variant :"chatkit.client_tool_call", + -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall } + + # Task emitted by the workflow to show progress and status updates. + variant :"chatkit.task", -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask } + + # Collection of workflow tasks grouped together in the thread. + variant :"chatkit.task_group", -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup } + + class ChatKitClientToolCall < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the thread item. + # + # @return [String] + required :id, String + + # @!attribute arguments + # JSON-encoded arguments that were sent to the tool. + # + # @return [String] + required :arguments, String + + # @!attribute call_id + # Identifier for the client tool call. + # + # @return [String] + required :call_id, String + + # @!attribute created_at + # Unix timestamp (in seconds) for when the item was created. + # + # @return [Integer] + required :created_at, Integer + + # @!attribute name + # Tool name that was invoked. + # + # @return [String] + required :name, String + + # @!attribute object + # Type discriminator that is always `chatkit.thread_item`. + # + # @return [Symbol, :"chatkit.thread_item"] + required :object, const: :"chatkit.thread_item" + + # @!attribute output + # JSON-encoded output captured from the tool. Defaults to null while execution is + # in progress. + # + # @return [String, nil] + required :output, String, nil?: true + + # @!attribute status + # Execution status for the tool call. + # + # @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status] + required :status, + enum: -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status } + + # @!attribute thread_id + # Identifier of the parent thread. + # + # @return [String] + required :thread_id, String + + # @!attribute type + # Type discriminator that is always `chatkit.client_tool_call`. + # + # @return [Symbol, :"chatkit.client_tool_call"] + required :type, const: :"chatkit.client_tool_call" + + # @!method initialize(id:, arguments:, call_id:, created_at:, name:, output:, status:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.client_tool_call") + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall} + # for more details. + # + # Record of a client side tool invocation initiated by the assistant. + # + # @param id [String] Identifier of the thread item. + # + # @param arguments [String] JSON-encoded arguments that were sent to the tool. + # + # @param call_id [String] Identifier for the client tool call. + # + # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created. + # + # @param name [String] Tool name that was invoked. + # + # @param output [String, nil] JSON-encoded output captured from the tool. Defaults to null while execution is + # + # @param status [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status] Execution status for the tool call. + # + # @param thread_id [String] Identifier of the parent thread. + # + # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`. + # + # @param type [Symbol, :"chatkit.client_tool_call"] Type discriminator that is always `chatkit.client_tool_call`. + + # Execution status for the tool call. + # + # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall#status + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS = :in_progress + COMPLETED = :completed + + # @!method self.values + # @return [Array] + end + end + + class ChatKitTask < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the thread item. + # + # @return [String] + required :id, String + + # @!attribute created_at + # Unix timestamp (in seconds) for when the item was created. + # + # @return [Integer] + required :created_at, Integer + + # @!attribute heading + # Optional heading for the task. Defaults to null when not provided. + # + # @return [String, nil] + required :heading, String, nil?: true + + # @!attribute object + # Type discriminator that is always `chatkit.thread_item`. + # + # @return [Symbol, :"chatkit.thread_item"] + required :object, const: :"chatkit.thread_item" + + # @!attribute summary + # Optional summary that describes the task. Defaults to null when omitted. + # + # @return [String, nil] + required :summary, String, nil?: true + + # @!attribute task_type + # Subtype for the task. + # + # @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType] + required :task_type, + enum: -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType } + + # @!attribute thread_id + # Identifier of the parent thread. + # + # @return [String] + required :thread_id, String + + # @!attribute type + # Type discriminator that is always `chatkit.task`. + # + # @return [Symbol, :"chatkit.task"] + required :type, const: :"chatkit.task" + + # @!method initialize(id:, created_at:, heading:, summary:, task_type:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.task") + # Task emitted by the workflow to show progress and status updates. + # + # @param id [String] Identifier of the thread item. + # + # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created. + # + # @param heading [String, nil] Optional heading for the task. Defaults to null when not provided. + # + # @param summary [String, nil] Optional summary that describes the task. Defaults to null when omitted. + # + # @param task_type [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType] Subtype for the task. + # + # @param thread_id [String] Identifier of the parent thread. + # + # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`. + # + # @param type [Symbol, :"chatkit.task"] Type discriminator that is always `chatkit.task`. + + # Subtype for the task. + # + # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask#task_type + module TaskType + extend OpenAI::Internal::Type::Enum + + CUSTOM = :custom + THOUGHT = :thought + + # @!method self.values + # @return [Array] + end + end + + class ChatKitTaskGroup < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the thread item. + # + # @return [String] + required :id, String + + # @!attribute created_at + # Unix timestamp (in seconds) for when the item was created. + # + # @return [Integer] + required :created_at, Integer + + # @!attribute object + # Type discriminator that is always `chatkit.thread_item`. + # + # @return [Symbol, :"chatkit.thread_item"] + required :object, const: :"chatkit.thread_item" + + # @!attribute tasks + # Tasks included in the group. + # + # @return [Array] + required :tasks, + -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task] } + + # @!attribute thread_id + # Identifier of the parent thread. + # + # @return [String] + required :thread_id, String + + # @!attribute type + # Type discriminator that is always `chatkit.task_group`. + # + # @return [Symbol, :"chatkit.task_group"] + required :type, const: :"chatkit.task_group" + + # @!method initialize(id:, created_at:, tasks:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.task_group") + # Collection of workflow tasks grouped together in the thread. + # + # @param id [String] Identifier of the thread item. + # + # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created. + # + # @param tasks [Array] Tasks included in the group. + # + # @param thread_id [String] Identifier of the parent thread. + # + # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`. + # + # @param type [Symbol, :"chatkit.task_group"] Type discriminator that is always `chatkit.task_group`. + + class Task < OpenAI::Internal::Type::BaseModel + # @!attribute heading + # Optional heading for the grouped task. Defaults to null when not provided. + # + # @return [String, nil] + required :heading, String, nil?: true + + # @!attribute summary + # Optional summary that describes the grouped task. Defaults to null when omitted. + # + # @return [String, nil] + required :summary, String, nil?: true + + # @!attribute type + # Subtype for the grouped task. + # + # @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type] + required :type, + enum: -> { OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type } + + # @!method initialize(heading:, summary:, type:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task} + # for more details. + # + # Task entry that appears within a TaskGroup. + # + # @param heading [String, nil] Optional heading for the grouped task. Defaults to null when not provided. + # + # @param summary [String, nil] Optional summary that describes the grouped task. Defaults to null when omitted. + # + # @param type [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type] Subtype for the grouped task. + + # Subtype for the grouped task. + # + # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task#type + module Type + extend OpenAI::Internal::Type::Enum + + CUSTOM = :custom + THOUGHT = :thought + + # @!method self.values + # @return [Array] + end + end + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem, OpenAI::Models::Beta::ChatKit::ChatKitThreadAssistantMessageItem, OpenAI::Models::Beta::ChatKit::ChatKitWidgetItem, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask, OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup)] + end + end + end + + ChatKitThreadItemList = ChatKit::ChatKitThreadItemList + end + end +end diff --git a/lib/openai/models/beta/chatkit/chatkit_thread_user_message_item.rb b/lib/openai/models/beta/chatkit/chatkit_thread_user_message_item.rb new file mode 100644 index 00000000..d89836ad --- /dev/null +++ b/lib/openai/models/beta/chatkit/chatkit_thread_user_message_item.rb @@ -0,0 +1,183 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatKitThreadUserMessageItem < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the thread item. + # + # @return [String] + required :id, String + + # @!attribute attachments + # Attachments associated with the user message. Defaults to an empty list. + # + # @return [Array] + required :attachments, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitAttachment] } + + # @!attribute content + # Ordered content elements supplied by the user. + # + # @return [Array] + required :content, + -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content] } + + # @!attribute created_at + # Unix timestamp (in seconds) for when the item was created. + # + # @return [Integer] + required :created_at, Integer + + # @!attribute inference_options + # Inference overrides applied to the message. Defaults to null when unset. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions, nil] + required :inference_options, + -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions }, + nil?: true + + # @!attribute object + # Type discriminator that is always `chatkit.thread_item`. + # + # @return [Symbol, :"chatkit.thread_item"] + required :object, const: :"chatkit.thread_item" + + # @!attribute thread_id + # Identifier of the parent thread. + # + # @return [String] + required :thread_id, String + + # @!attribute type + # + # @return [Symbol, :"chatkit.user_message"] + required :type, const: :"chatkit.user_message" + + # @!method initialize(id:, attachments:, content:, created_at:, inference_options:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.user_message") + # User-authored messages within a thread. + # + # @param id [String] Identifier of the thread item. + # + # @param attachments [Array] Attachments associated with the user message. Defaults to an empty list. + # + # @param content [Array] Ordered content elements supplied by the user. + # + # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created. + # + # @param inference_options [OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions, nil] Inference overrides applied to the message. Defaults to null when unset. + # + # @param thread_id [String] Identifier of the parent thread. + # + # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`. + # + # @param type [Symbol, :"chatkit.user_message"] + + # Content blocks that comprise a user message. + module Content + extend OpenAI::Internal::Type::Union + + discriminator :type + + # Text block that a user contributed to the thread. + variant :input_text, -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText } + + # Quoted snippet that the user referenced in their message. + variant :quoted_text, -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText } + + class InputText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # Plain-text content supplied by the user. + # + # @return [String] + required :text, String + + # @!attribute type + # Type discriminator that is always `input_text`. + # + # @return [Symbol, :input_text] + required :type, const: :input_text + + # @!method initialize(text:, type: :input_text) + # Text block that a user contributed to the thread. + # + # @param text [String] Plain-text content supplied by the user. + # + # @param type [Symbol, :input_text] Type discriminator that is always `input_text`. + end + + class QuotedText < OpenAI::Internal::Type::BaseModel + # @!attribute text + # Quoted text content. + # + # @return [String] + required :text, String + + # @!attribute type + # Type discriminator that is always `quoted_text`. + # + # @return [Symbol, :quoted_text] + required :type, const: :quoted_text + + # @!method initialize(text:, type: :quoted_text) + # Quoted snippet that the user referenced in their message. + # + # @param text [String] Quoted text content. + # + # @param type [Symbol, :quoted_text] Type discriminator that is always `quoted_text`. + end + + # @!method self.variants + # @return [Array(OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText, OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText)] + end + + # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem#inference_options + class InferenceOptions < OpenAI::Internal::Type::BaseModel + # @!attribute model + # Model name that generated the response. Defaults to null when using the session + # default. + # + # @return [String, nil] + required :model, String, nil?: true + + # @!attribute tool_choice + # Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice, nil] + required :tool_choice, + -> { OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice }, + nil?: true + + # @!method initialize(model:, tool_choice:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions} + # for more details. + # + # Inference overrides applied to the message. Defaults to null when unset. + # + # @param model [String, nil] Model name that generated the response. Defaults to null when using the session + # + # @param tool_choice [OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice, nil] Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + + # @see OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions#tool_choice + class ToolChoice < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the requested tool. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + # + # @param id [String] Identifier of the requested tool. + end + end + end + end + + ChatKitThreadUserMessageItem = ChatKit::ChatKitThreadUserMessageItem + end + end +end diff --git a/lib/openai/models/beta/chatkit/chatkit_widget_item.rb b/lib/openai/models/beta/chatkit/chatkit_widget_item.rb new file mode 100644 index 00000000..951566be --- /dev/null +++ b/lib/openai/models/beta/chatkit/chatkit_widget_item.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + class ChatKitWidgetItem < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the thread item. + # + # @return [String] + required :id, String + + # @!attribute created_at + # Unix timestamp (in seconds) for when the item was created. + # + # @return [Integer] + required :created_at, Integer + + # @!attribute object + # Type discriminator that is always `chatkit.thread_item`. + # + # @return [Symbol, :"chatkit.thread_item"] + required :object, const: :"chatkit.thread_item" + + # @!attribute thread_id + # Identifier of the parent thread. + # + # @return [String] + required :thread_id, String + + # @!attribute type + # Type discriminator that is always `chatkit.widget`. + # + # @return [Symbol, :"chatkit.widget"] + required :type, const: :"chatkit.widget" + + # @!attribute widget + # Serialized widget payload rendered in the UI. + # + # @return [String] + required :widget, String + + # @!method initialize(id:, created_at:, thread_id:, widget:, object: :"chatkit.thread_item", type: :"chatkit.widget") + # Thread item that renders a widget payload. + # + # @param id [String] Identifier of the thread item. + # + # @param created_at [Integer] Unix timestamp (in seconds) for when the item was created. + # + # @param thread_id [String] Identifier of the parent thread. + # + # @param widget [String] Serialized widget payload rendered in the UI. + # + # @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`. + # + # @param type [Symbol, :"chatkit.widget"] Type discriminator that is always `chatkit.widget`. + end + end + + ChatKitWidgetItem = ChatKit::ChatKitWidgetItem + end + end +end diff --git a/lib/openai/models/beta/chatkit/session_cancel_params.rb b/lib/openai/models/beta/chatkit/session_cancel_params.rb new file mode 100644 index 00000000..660b003f --- /dev/null +++ b/lib/openai/models/beta/chatkit/session_cancel_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + # @see OpenAI::Resources::Beta::ChatKit::Sessions#cancel + class SessionCancelParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/session_create_params.rb b/lib/openai/models/beta/chatkit/session_create_params.rb new file mode 100644 index 00000000..b8ecea40 --- /dev/null +++ b/lib/openai/models/beta/chatkit/session_create_params.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + # @see OpenAI::Resources::Beta::ChatKit::Sessions#create + class SessionCreateParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!attribute user + # A free-form string that identifies your end user; ensures this Session can + # access other objects that have the same `user` scope. + # + # @return [String] + required :user, String + + # @!attribute workflow + # Workflow that powers the session. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam] + required :workflow, -> { OpenAI::Beta::ChatKit::ChatSessionWorkflowParam } + + # @!attribute chatkit_configuration + # Optional overrides for ChatKit runtime configuration features + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam, nil] + optional :chatkit_configuration, -> { OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam } + + # @!attribute expires_after + # Optional override for session expiration timing in seconds from creation. + # Defaults to 10 minutes. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionExpiresAfterParam, nil] + optional :expires_after, -> { OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam } + + # @!attribute rate_limits + # Optional override for per-minute request limits. When omitted, defaults to 10. + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSessionRateLimitsParam, nil] + optional :rate_limits, -> { OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam } + + # @!method initialize(user:, workflow:, chatkit_configuration: nil, expires_after: nil, rate_limits: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::SessionCreateParams} for more details. + # + # @param user [String] A free-form string that identifies your end user; ensures this Session can acces + # + # @param workflow [OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam] Workflow that powers the session. + # + # @param chatkit_configuration [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam] Optional overrides for ChatKit runtime configuration features + # + # @param expires_after [OpenAI::Models::Beta::ChatKit::ChatSessionExpiresAfterParam] Optional override for session expiration timing in seconds from creation. Defaul + # + # @param rate_limits [OpenAI::Models::Beta::ChatKit::ChatSessionRateLimitsParam] Optional override for per-minute request limits. When omitted, defaults to 10. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/thread_delete_params.rb b/lib/openai/models/beta/chatkit/thread_delete_params.rb new file mode 100644 index 00000000..1f3f4b95 --- /dev/null +++ b/lib/openai/models/beta/chatkit/thread_delete_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + # @see OpenAI::Resources::Beta::ChatKit::Threads#delete + class ThreadDeleteParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/thread_delete_response.rb b/lib/openai/models/beta/chatkit/thread_delete_response.rb new file mode 100644 index 00000000..05d53435 --- /dev/null +++ b/lib/openai/models/beta/chatkit/thread_delete_response.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + # @see OpenAI::Resources::Beta::ChatKit::Threads#delete + class ThreadDeleteResponse < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the deleted thread. + # + # @return [String] + required :id, String + + # @!attribute deleted + # Indicates that the thread has been deleted. + # + # @return [Boolean] + required :deleted, OpenAI::Internal::Type::Boolean + + # @!attribute object + # Type discriminator that is always `chatkit.thread.deleted`. + # + # @return [Symbol, :"chatkit.thread.deleted"] + required :object, const: :"chatkit.thread.deleted" + + # @!method initialize(id:, deleted:, object: :"chatkit.thread.deleted") + # Confirmation payload returned after deleting a thread. + # + # @param id [String] Identifier of the deleted thread. + # + # @param deleted [Boolean] Indicates that the thread has been deleted. + # + # @param object [Symbol, :"chatkit.thread.deleted"] Type discriminator that is always `chatkit.thread.deleted`. + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/thread_list_items_params.rb b/lib/openai/models/beta/chatkit/thread_list_items_params.rb new file mode 100644 index 00000000..bf3992e1 --- /dev/null +++ b/lib/openai/models/beta/chatkit/thread_list_items_params.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + # @see OpenAI::Resources::Beta::ChatKit::Threads#list_items + class ThreadListItemsParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!attribute after + # List items created after this thread item ID. Defaults to null for the first + # page. + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # List items created before this thread item ID. Defaults to null for the newest + # results. + # + # @return [String, nil] + optional :before, String + + # @!attribute limit + # Maximum number of thread items to return. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute order + # Sort order for results by creation time. Defaults to `desc`. + # + # @return [Symbol, OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::Order, nil] + optional :order, enum: -> { OpenAI::Beta::ChatKit::ThreadListItemsParams::Order } + + # @!method initialize(after: nil, before: nil, limit: nil, order: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ThreadListItemsParams} for more details. + # + # @param after [String] List items created after this thread item ID. Defaults to null for the first pag + # + # @param before [String] List items created before this thread item ID. Defaults to null for the newest r + # + # @param limit [Integer] Maximum number of thread items to return. Defaults to 20. + # + # @param order [Symbol, OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::Order] Sort order for results by creation time. Defaults to `desc`. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + + # Sort order for results by creation time. Defaults to `desc`. + module Order + extend OpenAI::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/thread_list_params.rb b/lib/openai/models/beta/chatkit/thread_list_params.rb new file mode 100644 index 00000000..88b2c9b6 --- /dev/null +++ b/lib/openai/models/beta/chatkit/thread_list_params.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + # @see OpenAI::Resources::Beta::ChatKit::Threads#list + class ThreadListParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!attribute after + # List items created after this thread item ID. Defaults to null for the first + # page. + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # List items created before this thread item ID. Defaults to null for the newest + # results. + # + # @return [String, nil] + optional :before, String + + # @!attribute limit + # Maximum number of thread items to return. Defaults to 20. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute order + # Sort order for results by creation time. Defaults to `desc`. + # + # @return [Symbol, OpenAI::Models::Beta::ChatKit::ThreadListParams::Order, nil] + optional :order, enum: -> { OpenAI::Beta::ChatKit::ThreadListParams::Order } + + # @!attribute user + # Filter threads that belong to this user identifier. Defaults to null to return + # all users. + # + # @return [String, nil] + optional :user, String + + # @!method initialize(after: nil, before: nil, limit: nil, order: nil, user: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ThreadListParams} for more details. + # + # @param after [String] List items created after this thread item ID. Defaults to null for the first pag + # + # @param before [String] List items created before this thread item ID. Defaults to null for the newest r + # + # @param limit [Integer] Maximum number of thread items to return. Defaults to 20. + # + # @param order [Symbol, OpenAI::Models::Beta::ChatKit::ThreadListParams::Order] Sort order for results by creation time. Defaults to `desc`. + # + # @param user [String] Filter threads that belong to this user identifier. Defaults to null to return a + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + + # Sort order for results by creation time. Defaults to `desc`. + module Order + extend OpenAI::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit/thread_retrieve_params.rb b/lib/openai/models/beta/chatkit/thread_retrieve_params.rb new file mode 100644 index 00000000..41ee97a7 --- /dev/null +++ b/lib/openai/models/beta/chatkit/thread_retrieve_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + module ChatKit + # @see OpenAI::Resources::Beta::ChatKit::Threads#retrieve + class ThreadRetrieveParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/openai/models/beta/chatkit_upload_file_params.rb b/lib/openai/models/beta/chatkit_upload_file_params.rb new file mode 100644 index 00000000..fa5011a5 --- /dev/null +++ b/lib/openai/models/beta/chatkit_upload_file_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + # @see OpenAI::Resources::Beta::ChatKit#upload_file + class ChatKitUploadFileParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!attribute file + # Binary file contents to store with the ChatKit session. Supports PDFs and PNG, + # JPG, JPEG, GIF, or WEBP images. + # + # @return [Pathname, StringIO, IO, String, OpenAI::FilePart] + required :file, OpenAI::Internal::Type::FileInput + + # @!method initialize(file:, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKitUploadFileParams} for more details. + # + # @param file [Pathname, StringIO, IO, String, OpenAI::FilePart] Binary file contents to store with the ChatKit session. Supports PDFs and PNG, J + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/openai/models/beta/chatkit_upload_file_response.rb b/lib/openai/models/beta/chatkit_upload_file_response.rb new file mode 100644 index 00000000..7cd1133a --- /dev/null +++ b/lib/openai/models/beta/chatkit_upload_file_response.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + # Represents either a file or image attachment. + # + # @see OpenAI::Resources::Beta::ChatKit#upload_file + module ChatKitUploadFileResponse + extend OpenAI::Internal::Type::Union + + discriminator :type + + # Metadata for a non-image file uploaded through ChatKit. + variant :file, -> { OpenAI::Beta::FilePart } + + # Metadata for an image uploaded through ChatKit. + variant :image, -> { OpenAI::Beta::ImagePart } + + # @!method self.variants + # @return [Array(OpenAI::Models::Beta::FilePart, OpenAI::Models::Beta::ImagePart)] + end + end + end +end diff --git a/lib/openai/models/beta/chatkit_workflow.rb b/lib/openai/models/beta/chatkit_workflow.rb new file mode 100644 index 00000000..96b8f1d0 --- /dev/null +++ b/lib/openai/models/beta/chatkit_workflow.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + class ChatKitWorkflow < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the workflow backing the session. + # + # @return [String] + required :id, String + + # @!attribute state_variables + # State variable key-value pairs applied when invoking the workflow. Defaults to + # null when no overrides were provided. + # + # @return [Hash{Symbol=>String, Boolean, Float}, nil] + required :state_variables, + -> { OpenAI::Internal::Type::HashOf[union: OpenAI::Beta::ChatKitWorkflow::StateVariable] }, + nil?: true + + # @!attribute tracing + # Tracing settings applied to the workflow. + # + # @return [OpenAI::Models::Beta::ChatKitWorkflow::Tracing] + required :tracing, -> { OpenAI::Beta::ChatKitWorkflow::Tracing } + + # @!attribute version + # Specific workflow version used for the session. Defaults to null when using the + # latest deployment. + # + # @return [String, nil] + required :version, String, nil?: true + + # @!method initialize(id:, state_variables:, tracing:, version:) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKitWorkflow} for more details. + # + # Workflow metadata and state returned for the session. + # + # @param id [String] Identifier of the workflow backing the session. + # + # @param state_variables [Hash{Symbol=>String, Boolean, Float}, nil] State variable key-value pairs applied when invoking the workflow. Defaults to n + # + # @param tracing [OpenAI::Models::Beta::ChatKitWorkflow::Tracing] Tracing settings applied to the workflow. + # + # @param version [String, nil] Specific workflow version used for the session. Defaults to null when using the + + module StateVariable + extend OpenAI::Internal::Type::Union + + variant String + + variant OpenAI::Internal::Type::Boolean + + variant Float + + # @!method self.variants + # @return [Array(String, Boolean, Float)] + end + + # @see OpenAI::Models::Beta::ChatKitWorkflow#tracing + class Tracing < OpenAI::Internal::Type::BaseModel + # @!attribute enabled + # Indicates whether tracing is enabled. + # + # @return [Boolean] + required :enabled, OpenAI::Internal::Type::Boolean + + # @!method initialize(enabled:) + # Tracing settings applied to the workflow. + # + # @param enabled [Boolean] Indicates whether tracing is enabled. + end + end + end + end +end diff --git a/lib/openai/models/beta/file_part.rb b/lib/openai/models/beta/file_part.rb new file mode 100644 index 00000000..6e41e5f9 --- /dev/null +++ b/lib/openai/models/beta/file_part.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + class FilePart < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the uploaded file. + # + # @return [String] + required :id, String + + # @!attribute mime_type + # MIME type reported for the uploaded file. Defaults to null when unknown. + # + # @return [String, nil] + required :mime_type, String, nil?: true + + # @!attribute name + # Original filename supplied by the uploader. Defaults to null when unnamed. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute type + # Type discriminator that is always `file`. + # + # @return [Symbol, :file] + required :type, const: :file + + # @!attribute upload_url + # Signed URL for downloading the uploaded file. Defaults to null when no download + # link is available. + # + # @return [String, nil] + required :upload_url, String, nil?: true + + # @!method initialize(id:, mime_type:, name:, upload_url:, type: :file) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::FilePart} for more details. + # + # Metadata for a non-image file uploaded through ChatKit. + # + # @param id [String] Unique identifier for the uploaded file. + # + # @param mime_type [String, nil] MIME type reported for the uploaded file. Defaults to null when unknown. + # + # @param name [String, nil] Original filename supplied by the uploader. Defaults to null when unnamed. + # + # @param upload_url [String, nil] Signed URL for downloading the uploaded file. Defaults to null when no download + # + # @param type [Symbol, :file] Type discriminator that is always `file`. + end + end + end +end diff --git a/lib/openai/models/beta/image_part.rb b/lib/openai/models/beta/image_part.rb new file mode 100644 index 00000000..eec55f01 --- /dev/null +++ b/lib/openai/models/beta/image_part.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module Beta + class ImagePart < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the uploaded image. + # + # @return [String] + required :id, String + + # @!attribute mime_type + # MIME type of the uploaded image. + # + # @return [String] + required :mime_type, String + + # @!attribute name + # Original filename for the uploaded image. Defaults to null when unnamed. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute preview_url + # Preview URL that can be rendered inline for the image. + # + # @return [String] + required :preview_url, String + + # @!attribute type + # Type discriminator that is always `image`. + # + # @return [Symbol, :image] + required :type, const: :image + + # @!attribute upload_url + # Signed URL for downloading the uploaded image. Defaults to null when no download + # link is available. + # + # @return [String, nil] + required :upload_url, String, nil?: true + + # @!method initialize(id:, mime_type:, name:, preview_url:, upload_url:, type: :image) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ImagePart} for more details. + # + # Metadata for an image uploaded through ChatKit. + # + # @param id [String] Unique identifier for the uploaded image. + # + # @param mime_type [String] MIME type of the uploaded image. + # + # @param name [String, nil] Original filename for the uploaded image. Defaults to null when unnamed. + # + # @param preview_url [String] Preview URL that can be rendered inline for the image. + # + # @param upload_url [String, nil] Signed URL for downloading the uploaded image. Defaults to null when no download + # + # @param type [Symbol, :image] Type discriminator that is always `image`. + end + end + end +end diff --git a/lib/openai/models/image_edit_params.rb b/lib/openai/models/image_edit_params.rb index aee4b491..18e520b0 100644 --- a/lib/openai/models/image_edit_params.rb +++ b/lib/openai/models/image_edit_params.rb @@ -43,7 +43,8 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # @!attribute input_fidelity # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. # # @return [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil] optional :input_fidelity, enum: -> { OpenAI::ImageEditParams::InputFidelity }, nil?: true @@ -206,7 +207,8 @@ module Background # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. module InputFidelity extend OpenAI::Internal::Type::Enum diff --git a/lib/openai/models/image_model.rb b/lib/openai/models/image_model.rb index 0bd2690e..6f0a522e 100644 --- a/lib/openai/models/image_model.rb +++ b/lib/openai/models/image_model.rb @@ -8,6 +8,7 @@ module ImageModel DALL_E_2 = :"dall-e-2" DALL_E_3 = :"dall-e-3" GPT_IMAGE_1 = :"gpt-image-1" + GPT_IMAGE_1_MINI = :"gpt-image-1-mini" # @!method self.values # @return [Array] diff --git a/lib/openai/models/realtime/realtime_session.rb b/lib/openai/models/realtime/realtime_session.rb index 74db4075..9983d359 100644 --- a/lib/openai/models/realtime/realtime_session.rb +++ b/lib/openai/models/realtime/realtime_session.rb @@ -316,6 +316,10 @@ module Model GPT_4O_REALTIME_PREVIEW_2025_06_03 = :"gpt-4o-realtime-preview-2025-06-03" GPT_4O_MINI_REALTIME_PREVIEW = :"gpt-4o-mini-realtime-preview" GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17 = :"gpt-4o-mini-realtime-preview-2024-12-17" + GPT_REALTIME_MINI = :"gpt-realtime-mini" + GPT_REALTIME_MINI_2025_10_06 = :"gpt-realtime-mini-2025-10-06" + GPT_AUDIO_MINI = :"gpt-audio-mini" + GPT_AUDIO_MINI_2025_10_06 = :"gpt-audio-mini-2025-10-06" # @!method self.values # @return [Array] diff --git a/lib/openai/models/realtime/realtime_session_create_request.rb b/lib/openai/models/realtime/realtime_session_create_request.rb index e668357e..7eef6d7e 100644 --- a/lib/openai/models/realtime/realtime_session_create_request.rb +++ b/lib/openai/models/realtime/realtime_session_create_request.rb @@ -183,6 +183,14 @@ module Model variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17 } + variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_REALTIME_MINI } + + variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_REALTIME_MINI_2025_10_06 } + + variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_AUDIO_MINI } + + variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateRequest::Model::GPT_AUDIO_MINI_2025_10_06 } + # @!method self.variants # @return [Array(String, Symbol)] @@ -200,6 +208,10 @@ module Model GPT_4O_REALTIME_PREVIEW_2025_06_03 = :"gpt-4o-realtime-preview-2025-06-03" GPT_4O_MINI_REALTIME_PREVIEW = :"gpt-4o-mini-realtime-preview" GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17 = :"gpt-4o-mini-realtime-preview-2024-12-17" + GPT_REALTIME_MINI = :"gpt-realtime-mini" + GPT_REALTIME_MINI_2025_10_06 = :"gpt-realtime-mini-2025-10-06" + GPT_AUDIO_MINI = :"gpt-audio-mini" + GPT_AUDIO_MINI_2025_10_06 = :"gpt-audio-mini-2025-10-06" # @!endgroup end diff --git a/lib/openai/models/realtime/realtime_session_create_response.rb b/lib/openai/models/realtime/realtime_session_create_response.rb index 79dcc176..5960952f 100644 --- a/lib/openai/models/realtime/realtime_session_create_response.rb +++ b/lib/openai/models/realtime/realtime_session_create_response.rb @@ -584,6 +584,14 @@ module Model variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17 } + variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_REALTIME_MINI } + + variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_REALTIME_MINI_2025_10_06 } + + variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_AUDIO_MINI } + + variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Model::GPT_AUDIO_MINI_2025_10_06 } + # @!method self.variants # @return [Array(String, Symbol)] @@ -601,6 +609,10 @@ module Model GPT_4O_REALTIME_PREVIEW_2025_06_03 = :"gpt-4o-realtime-preview-2025-06-03" GPT_4O_MINI_REALTIME_PREVIEW = :"gpt-4o-mini-realtime-preview" GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17 = :"gpt-4o-mini-realtime-preview-2024-12-17" + GPT_REALTIME_MINI = :"gpt-realtime-mini" + GPT_REALTIME_MINI_2025_10_06 = :"gpt-realtime-mini-2025-10-06" + GPT_AUDIO_MINI = :"gpt-audio-mini" + GPT_AUDIO_MINI_2025_10_06 = :"gpt-audio-mini-2025-10-06" # @!endgroup end diff --git a/lib/openai/models/responses/tool.rb b/lib/openai/models/responses/tool.rb index 2923875e..bb466067 100644 --- a/lib/openai/models/responses/tool.rb +++ b/lib/openai/models/responses/tool.rb @@ -427,7 +427,8 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # @!attribute input_fidelity # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. # # @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::InputFidelity, nil] optional :input_fidelity, @@ -534,7 +535,8 @@ module Background # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. # # @see OpenAI::Models::Responses::Tool::ImageGeneration#input_fidelity module InputFidelity @@ -581,6 +583,7 @@ module Model extend OpenAI::Internal::Type::Enum GPT_IMAGE_1 = :"gpt-image-1" + GPT_IMAGE_1_MINI = :"gpt-image-1-mini" # @!method self.values # @return [Array] diff --git a/lib/openai/models/responses_model.rb b/lib/openai/models/responses_model.rb index 4f642c88..316b2725 100644 --- a/lib/openai/models/responses_model.rb +++ b/lib/openai/models/responses_model.rb @@ -25,6 +25,8 @@ module ResponsesOnlyModel COMPUTER_USE_PREVIEW = :"computer-use-preview" COMPUTER_USE_PREVIEW_2025_03_11 = :"computer-use-preview-2025-03-11" GPT_5_CODEX = :"gpt-5-codex" + GPT_5_PRO = :"gpt-5-pro" + GPT_5_PRO_2025_10_06 = :"gpt-5-pro-2025-10-06" # @!method self.values # @return [Array] diff --git a/lib/openai/models/video.rb b/lib/openai/models/video.rb new file mode 100644 index 00000000..6537b78b --- /dev/null +++ b/lib/openai/models/video.rb @@ -0,0 +1,122 @@ +# frozen_string_literal: true + +module OpenAI + module Models + # @see OpenAI::Resources::Videos#create + class Video < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the video job. + # + # @return [String] + required :id, String + + # @!attribute completed_at + # Unix timestamp (seconds) for when the job completed, if finished. + # + # @return [Integer, nil] + required :completed_at, Integer, nil?: true + + # @!attribute created_at + # Unix timestamp (seconds) for when the job was created. + # + # @return [Integer] + required :created_at, Integer + + # @!attribute error + # Error payload that explains why generation failed, if applicable. + # + # @return [OpenAI::Models::VideoCreateError, nil] + required :error, -> { OpenAI::VideoCreateError }, nil?: true + + # @!attribute expires_at + # Unix timestamp (seconds) for when the downloadable assets expire, if set. + # + # @return [Integer, nil] + required :expires_at, Integer, nil?: true + + # @!attribute model + # The video generation model that produced the job. + # + # @return [Symbol, OpenAI::Models::VideoModel] + required :model, enum: -> { OpenAI::VideoModel } + + # @!attribute object + # The object type, which is always `video`. + # + # @return [Symbol, :video] + required :object, const: :video + + # @!attribute progress + # Approximate completion percentage for the generation task. + # + # @return [Integer] + required :progress, Integer + + # @!attribute remixed_from_video_id + # Identifier of the source video if this video is a remix. + # + # @return [String, nil] + required :remixed_from_video_id, String, nil?: true + + # @!attribute seconds + # Duration of the generated clip in seconds. + # + # @return [Symbol, OpenAI::Models::VideoSeconds] + required :seconds, enum: -> { OpenAI::VideoSeconds } + + # @!attribute size + # The resolution of the generated video. + # + # @return [Symbol, OpenAI::Models::VideoSize] + required :size, enum: -> { OpenAI::VideoSize } + + # @!attribute status + # Current lifecycle status of the video job. + # + # @return [Symbol, OpenAI::Models::Video::Status] + required :status, enum: -> { OpenAI::Video::Status } + + # @!method initialize(id:, completed_at:, created_at:, error:, expires_at:, model:, progress:, remixed_from_video_id:, seconds:, size:, status:, object: :video) + # Structured information describing a generated video job. + # + # @param id [String] Unique identifier for the video job. + # + # @param completed_at [Integer, nil] Unix timestamp (seconds) for when the job completed, if finished. + # + # @param created_at [Integer] Unix timestamp (seconds) for when the job was created. + # + # @param error [OpenAI::Models::VideoCreateError, nil] Error payload that explains why generation failed, if applicable. + # + # @param expires_at [Integer, nil] Unix timestamp (seconds) for when the downloadable assets expire, if set. + # + # @param model [Symbol, OpenAI::Models::VideoModel] The video generation model that produced the job. + # + # @param progress [Integer] Approximate completion percentage for the generation task. + # + # @param remixed_from_video_id [String, nil] Identifier of the source video if this video is a remix. + # + # @param seconds [Symbol, OpenAI::Models::VideoSeconds] Duration of the generated clip in seconds. + # + # @param size [Symbol, OpenAI::Models::VideoSize] The resolution of the generated video. + # + # @param status [Symbol, OpenAI::Models::Video::Status] Current lifecycle status of the video job. + # + # @param object [Symbol, :video] The object type, which is always `video`. + + # Current lifecycle status of the video job. + # + # @see OpenAI::Models::Video#status + module Status + extend OpenAI::Internal::Type::Enum + + QUEUED = :queued + IN_PROGRESS = :in_progress + COMPLETED = :completed + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/openai/models/video_create_error.rb b/lib/openai/models/video_create_error.rb new file mode 100644 index 00000000..5f2d18e8 --- /dev/null +++ b/lib/openai/models/video_create_error.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module OpenAI + module Models + class VideoCreateError < OpenAI::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute message + # + # @return [String] + required :message, String + + # @!method initialize(code:, message:) + # @param code [String] + # @param message [String] + end + end +end diff --git a/lib/openai/models/video_create_params.rb b/lib/openai/models/video_create_params.rb new file mode 100644 index 00000000..9f018531 --- /dev/null +++ b/lib/openai/models/video_create_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module OpenAI + module Models + # @see OpenAI::Resources::Videos#create + class VideoCreateParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!attribute prompt + # Text prompt that describes the video to generate. + # + # @return [String] + required :prompt, String + + # @!attribute input_reference + # Optional image reference that guides generation. + # + # @return [Pathname, StringIO, IO, String, OpenAI::FilePart, nil] + optional :input_reference, OpenAI::Internal::Type::FileInput + + # @!attribute model + # The video generation model to use. Defaults to `sora-2`. + # + # @return [Symbol, OpenAI::Models::VideoModel, nil] + optional :model, enum: -> { OpenAI::VideoModel } + + # @!attribute seconds + # Clip duration in seconds. Defaults to 4 seconds. + # + # @return [Symbol, OpenAI::Models::VideoSeconds, nil] + optional :seconds, enum: -> { OpenAI::VideoSeconds } + + # @!attribute size + # Output resolution formatted as width x height. Defaults to 720x1280. + # + # @return [Symbol, OpenAI::Models::VideoSize, nil] + optional :size, enum: -> { OpenAI::VideoSize } + + # @!method initialize(prompt:, input_reference: nil, model: nil, seconds: nil, size: nil, request_options: {}) + # @param prompt [String] Text prompt that describes the video to generate. + # + # @param input_reference [Pathname, StringIO, IO, String, OpenAI::FilePart] Optional image reference that guides generation. + # + # @param model [Symbol, OpenAI::Models::VideoModel] The video generation model to use. Defaults to `sora-2`. + # + # @param seconds [Symbol, OpenAI::Models::VideoSeconds] Clip duration in seconds. Defaults to 4 seconds. + # + # @param size [Symbol, OpenAI::Models::VideoSize] Output resolution formatted as width x height. Defaults to 720x1280. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/openai/models/video_delete_params.rb b/lib/openai/models/video_delete_params.rb new file mode 100644 index 00000000..7adb638f --- /dev/null +++ b/lib/openai/models/video_delete_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module OpenAI + module Models + # @see OpenAI::Resources::Videos#delete + class VideoDeleteParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/openai/models/video_delete_response.rb b/lib/openai/models/video_delete_response.rb new file mode 100644 index 00000000..3e30fbf5 --- /dev/null +++ b/lib/openai/models/video_delete_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module OpenAI + module Models + # @see OpenAI::Resources::Videos#delete + class VideoDeleteResponse < OpenAI::Internal::Type::BaseModel + # @!attribute id + # Identifier of the deleted video. + # + # @return [String] + required :id, String + + # @!attribute deleted + # Indicates that the video resource was deleted. + # + # @return [Boolean] + required :deleted, OpenAI::Internal::Type::Boolean + + # @!attribute object + # The object type that signals the deletion response. + # + # @return [Symbol, :"video.deleted"] + required :object, const: :"video.deleted" + + # @!method initialize(id:, deleted:, object: :"video.deleted") + # Confirmation payload returned after deleting a video. + # + # @param id [String] Identifier of the deleted video. + # + # @param deleted [Boolean] Indicates that the video resource was deleted. + # + # @param object [Symbol, :"video.deleted"] The object type that signals the deletion response. + end + end +end diff --git a/lib/openai/models/video_download_content_params.rb b/lib/openai/models/video_download_content_params.rb new file mode 100644 index 00000000..05378da6 --- /dev/null +++ b/lib/openai/models/video_download_content_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module OpenAI + module Models + # @see OpenAI::Resources::Videos#download_content + class VideoDownloadContentParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!attribute variant + # Which downloadable asset to return. Defaults to the MP4 video. + # + # @return [Symbol, OpenAI::Models::VideoDownloadContentParams::Variant, nil] + optional :variant, enum: -> { OpenAI::VideoDownloadContentParams::Variant } + + # @!method initialize(variant: nil, request_options: {}) + # @param variant [Symbol, OpenAI::Models::VideoDownloadContentParams::Variant] Which downloadable asset to return. Defaults to the MP4 video. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + + # Which downloadable asset to return. Defaults to the MP4 video. + module Variant + extend OpenAI::Internal::Type::Enum + + VIDEO = :video + THUMBNAIL = :thumbnail + SPRITESHEET = :spritesheet + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/openai/models/video_list_params.rb b/lib/openai/models/video_list_params.rb new file mode 100644 index 00000000..72166e55 --- /dev/null +++ b/lib/openai/models/video_list_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module OpenAI + module Models + # @see OpenAI::Resources::Videos#list + class VideoListParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!attribute after + # Identifier for the last item from the previous pagination request + # + # @return [String, nil] + optional :after, String + + # @!attribute limit + # Number of items to retrieve + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute order + # Sort order of results by timestamp. Use `asc` for ascending order or `desc` for + # descending order. + # + # @return [Symbol, OpenAI::Models::VideoListParams::Order, nil] + optional :order, enum: -> { OpenAI::VideoListParams::Order } + + # @!method initialize(after: nil, limit: nil, order: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VideoListParams} for more details. + # + # @param after [String] Identifier for the last item from the previous pagination request + # + # @param limit [Integer] Number of items to retrieve + # + # @param order [Symbol, OpenAI::Models::VideoListParams::Order] Sort order of results by timestamp. Use `asc` for ascending order or `desc` for + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + + # Sort order of results by timestamp. Use `asc` for ascending order or `desc` for + # descending order. + module Order + extend OpenAI::Internal::Type::Enum + + ASC = :asc + DESC = :desc + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/openai/models/video_model.rb b/lib/openai/models/video_model.rb new file mode 100644 index 00000000..95dc001c --- /dev/null +++ b/lib/openai/models/video_model.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module VideoModel + extend OpenAI::Internal::Type::Enum + + SORA_2 = :"sora-2" + SORA_2_PRO = :"sora-2-pro" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/openai/models/video_remix_params.rb b/lib/openai/models/video_remix_params.rb new file mode 100644 index 00000000..e434f554 --- /dev/null +++ b/lib/openai/models/video_remix_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module OpenAI + module Models + # @see OpenAI::Resources::Videos#remix + class VideoRemixParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!attribute prompt + # Updated text prompt that directs the remix generation. + # + # @return [String] + required :prompt, String + + # @!method initialize(prompt:, request_options: {}) + # @param prompt [String] Updated text prompt that directs the remix generation. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/openai/models/video_retrieve_params.rb b/lib/openai/models/video_retrieve_params.rb new file mode 100644 index 00000000..7ba9a6ec --- /dev/null +++ b/lib/openai/models/video_retrieve_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module OpenAI + module Models + # @see OpenAI::Resources::Videos#retrieve + class VideoRetrieveParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/openai/models/video_seconds.rb b/lib/openai/models/video_seconds.rb new file mode 100644 index 00000000..d02fd157 --- /dev/null +++ b/lib/openai/models/video_seconds.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module VideoSeconds + extend OpenAI::Internal::Type::Enum + + VIDEO_SECONDS_4 = :"4" + VIDEO_SECONDS_8 = :"8" + VIDEO_SECONDS_12 = :"12" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/openai/models/video_size.rb b/lib/openai/models/video_size.rb new file mode 100644 index 00000000..4d598709 --- /dev/null +++ b/lib/openai/models/video_size.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module OpenAI + module Models + module VideoSize + extend OpenAI::Internal::Type::Enum + + VIDEO_SIZE_720X1280 = :"720x1280" + VIDEO_SIZE_1280X720 = :"1280x720" + VIDEO_SIZE_1024X1792 = :"1024x1792" + VIDEO_SIZE_1792X1024 = :"1792x1024" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/openai/resources/beta.rb b/lib/openai/resources/beta.rb index 62d4e049..0b8fdbce 100644 --- a/lib/openai/resources/beta.rb +++ b/lib/openai/resources/beta.rb @@ -3,6 +3,9 @@ module OpenAI module Resources class Beta + # @return [OpenAI::Resources::Beta::ChatKit] + attr_reader :chatkit + # @return [OpenAI::Resources::Beta::Assistants] attr_reader :assistants @@ -14,6 +17,7 @@ class Beta # @param client [OpenAI::Client] def initialize(client:) @client = client + @chatkit = OpenAI::Resources::Beta::ChatKit.new(client: client) @assistants = OpenAI::Resources::Beta::Assistants.new(client: client) @threads = OpenAI::Resources::Beta::Threads.new(client: client) end diff --git a/lib/openai/resources/beta/chatkit.rb b/lib/openai/resources/beta/chatkit.rb new file mode 100644 index 00000000..5ae792bf --- /dev/null +++ b/lib/openai/resources/beta/chatkit.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module OpenAI + module Resources + class Beta + class ChatKit + # @return [OpenAI::Resources::Beta::ChatKit::Sessions] + attr_reader :sessions + + # @return [OpenAI::Resources::Beta::ChatKit::Threads] + attr_reader :threads + + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKitUploadFileParams} for more details. + # + # Upload a ChatKit file + # + # @overload upload_file(file:, request_options: {}) + # + # @param file [Pathname, StringIO, IO, String, OpenAI::FilePart] Binary file contents to store with the ChatKit session. Supports PDFs and PNG, J + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::Beta::FilePart, OpenAI::Models::Beta::ImagePart] + # + # @see OpenAI::Models::Beta::ChatKitUploadFileParams + def upload_file(params) + parsed, options = OpenAI::Beta::ChatKitUploadFileParams.dump_request(params) + @client.request( + method: :post, + path: "chatkit/files", + headers: {"content-type" => "multipart/form-data"}, + body: parsed, + model: OpenAI::Models::Beta::ChatKitUploadFileResponse, + options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **options} + ) + end + + # @api private + # + # @param client [OpenAI::Client] + def initialize(client:) + @client = client + @sessions = OpenAI::Resources::Beta::ChatKit::Sessions.new(client: client) + @threads = OpenAI::Resources::Beta::ChatKit::Threads.new(client: client) + end + end + end + end +end diff --git a/lib/openai/resources/beta/chatkit/sessions.rb b/lib/openai/resources/beta/chatkit/sessions.rb new file mode 100644 index 00000000..9aaa09b2 --- /dev/null +++ b/lib/openai/resources/beta/chatkit/sessions.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module OpenAI + module Resources + class Beta + class ChatKit + class Sessions + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::SessionCreateParams} for more details. + # + # Create a ChatKit session + # + # @overload create(user:, workflow:, chatkit_configuration: nil, expires_after: nil, rate_limits: nil, request_options: {}) + # + # @param user [String] A free-form string that identifies your end user; ensures this Session can acces + # + # @param workflow [OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam] Workflow that powers the session. + # + # @param chatkit_configuration [OpenAI::Models::Beta::ChatKit::ChatSessionChatKitConfigurationParam] Optional overrides for ChatKit runtime configuration features + # + # @param expires_after [OpenAI::Models::Beta::ChatKit::ChatSessionExpiresAfterParam] Optional override for session expiration timing in seconds from creation. Defaul + # + # @param rate_limits [OpenAI::Models::Beta::ChatKit::ChatSessionRateLimitsParam] Optional override for per-minute request limits. When omitted, defaults to 10. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSession] + # + # @see OpenAI::Models::Beta::ChatKit::SessionCreateParams + def create(params) + parsed, options = OpenAI::Beta::ChatKit::SessionCreateParams.dump_request(params) + @client.request( + method: :post, + path: "chatkit/sessions", + body: parsed, + model: OpenAI::Beta::ChatKit::ChatSession, + options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **options} + ) + end + + # Cancel a ChatKit session + # + # @overload cancel(session_id, request_options: {}) + # + # @param session_id [String] Unique identifier for the ChatKit session to cancel. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::Beta::ChatKit::ChatSession] + # + # @see OpenAI::Models::Beta::ChatKit::SessionCancelParams + def cancel(session_id, params = {}) + @client.request( + method: :post, + path: ["chatkit/sessions/%1$s/cancel", session_id], + model: OpenAI::Beta::ChatKit::ChatSession, + options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **params[:request_options].to_h} + ) + end + + # @api private + # + # @param client [OpenAI::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/openai/resources/beta/chatkit/threads.rb b/lib/openai/resources/beta/chatkit/threads.rb new file mode 100644 index 00000000..c1de6547 --- /dev/null +++ b/lib/openai/resources/beta/chatkit/threads.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +module OpenAI + module Resources + class Beta + class ChatKit + class Threads + # Retrieve a ChatKit thread + # + # @overload retrieve(thread_id, request_options: {}) + # + # @param thread_id [String] Identifier of the ChatKit thread to retrieve. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::Beta::ChatKit::ChatKitThread] + # + # @see OpenAI::Models::Beta::ChatKit::ThreadRetrieveParams + def retrieve(thread_id, params = {}) + @client.request( + method: :get, + path: ["chatkit/threads/%1$s", thread_id], + model: OpenAI::Beta::ChatKit::ChatKitThread, + options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **params[:request_options].to_h} + ) + end + + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ThreadListParams} for more details. + # + # List ChatKit threads + # + # @overload list(after: nil, before: nil, limit: nil, order: nil, user: nil, request_options: {}) + # + # @param after [String] List items created after this thread item ID. Defaults to null for the first pag + # + # @param before [String] List items created before this thread item ID. Defaults to null for the newest r + # + # @param limit [Integer] Maximum number of thread items to return. Defaults to 20. + # + # @param order [Symbol, OpenAI::Models::Beta::ChatKit::ThreadListParams::Order] Sort order for results by creation time. Defaults to `desc`. + # + # @param user [String] Filter threads that belong to this user identifier. Defaults to null to return a + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Internal::ConversationCursorPage] + # + # @see OpenAI::Models::Beta::ChatKit::ThreadListParams + def list(params = {}) + parsed, options = OpenAI::Beta::ChatKit::ThreadListParams.dump_request(params) + @client.request( + method: :get, + path: "chatkit/threads", + query: parsed, + page: OpenAI::Internal::ConversationCursorPage, + model: OpenAI::Beta::ChatKit::ChatKitThread, + options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **options} + ) + end + + # Delete a ChatKit thread + # + # @overload delete(thread_id, request_options: {}) + # + # @param thread_id [String] Identifier of the ChatKit thread to delete. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::Beta::ChatKit::ThreadDeleteResponse] + # + # @see OpenAI::Models::Beta::ChatKit::ThreadDeleteParams + def delete(thread_id, params = {}) + @client.request( + method: :delete, + path: ["chatkit/threads/%1$s", thread_id], + model: OpenAI::Models::Beta::ChatKit::ThreadDeleteResponse, + options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **params[:request_options].to_h} + ) + end + + # Some parameter documentations has been truncated, see + # {OpenAI::Models::Beta::ChatKit::ThreadListItemsParams} for more details. + # + # List ChatKit thread items + # + # @overload list_items(thread_id, after: nil, before: nil, limit: nil, order: nil, request_options: {}) + # + # @param thread_id [String] Identifier of the ChatKit thread whose items are requested. + # + # @param after [String] List items created after this thread item ID. Defaults to null for the first pag + # + # @param before [String] List items created before this thread item ID. Defaults to null for the newest r + # + # @param limit [Integer] Maximum number of thread items to return. Defaults to 20. + # + # @param order [Symbol, OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::Order] Sort order for results by creation time. Defaults to `desc`. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Internal::ConversationCursorPage] + # + # @see OpenAI::Models::Beta::ChatKit::ThreadListItemsParams + def list_items(thread_id, params = {}) + parsed, options = OpenAI::Beta::ChatKit::ThreadListItemsParams.dump_request(params) + @client.request( + method: :get, + path: ["chatkit/threads/%1$s/items", thread_id], + query: parsed, + page: OpenAI::Internal::ConversationCursorPage, + model: OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data, + options: {extra_headers: {"OpenAI-Beta" => "chatkit_beta=v1"}, **options} + ) + end + + # @api private + # + # @param client [OpenAI::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/openai/resources/videos.rb b/lib/openai/resources/videos.rb new file mode 100644 index 00000000..26b486c1 --- /dev/null +++ b/lib/openai/resources/videos.rb @@ -0,0 +1,165 @@ +# frozen_string_literal: true + +module OpenAI + module Resources + class Videos + # Create a video + # + # @overload create(prompt:, input_reference: nil, model: nil, seconds: nil, size: nil, request_options: {}) + # + # @param prompt [String] Text prompt that describes the video to generate. + # + # @param input_reference [Pathname, StringIO, IO, String, OpenAI::FilePart] Optional image reference that guides generation. + # + # @param model [Symbol, OpenAI::Models::VideoModel] The video generation model to use. Defaults to `sora-2`. + # + # @param seconds [Symbol, OpenAI::Models::VideoSeconds] Clip duration in seconds. Defaults to 4 seconds. + # + # @param size [Symbol, OpenAI::Models::VideoSize] Output resolution formatted as width x height. Defaults to 720x1280. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::Video] + # + # @see OpenAI::Models::VideoCreateParams + def create(params) + parsed, options = OpenAI::VideoCreateParams.dump_request(params) + @client.request( + method: :post, + path: "videos", + headers: {"content-type" => "multipart/form-data"}, + body: parsed, + model: OpenAI::Video, + options: options + ) + end + + # Retrieve a video + # + # @overload retrieve(video_id, request_options: {}) + # + # @param video_id [String] The identifier of the video to retrieve. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::Video] + # + # @see OpenAI::Models::VideoRetrieveParams + def retrieve(video_id, params = {}) + @client.request( + method: :get, + path: ["videos/%1$s", video_id], + model: OpenAI::Video, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {OpenAI::Models::VideoListParams} for more details. + # + # List videos + # + # @overload list(after: nil, limit: nil, order: nil, request_options: {}) + # + # @param after [String] Identifier for the last item from the previous pagination request + # + # @param limit [Integer] Number of items to retrieve + # + # @param order [Symbol, OpenAI::Models::VideoListParams::Order] Sort order of results by timestamp. Use `asc` for ascending order or `desc` for + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Internal::ConversationCursorPage] + # + # @see OpenAI::Models::VideoListParams + def list(params = {}) + parsed, options = OpenAI::VideoListParams.dump_request(params) + @client.request( + method: :get, + path: "videos", + query: parsed, + page: OpenAI::Internal::ConversationCursorPage, + model: OpenAI::Video, + options: options + ) + end + + # Delete a video + # + # @overload delete(video_id, request_options: {}) + # + # @param video_id [String] The identifier of the video to delete. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::VideoDeleteResponse] + # + # @see OpenAI::Models::VideoDeleteParams + def delete(video_id, params = {}) + @client.request( + method: :delete, + path: ["videos/%1$s", video_id], + model: OpenAI::Models::VideoDeleteResponse, + options: params[:request_options] + ) + end + + # Download video content + # + # @overload download_content(video_id, variant: nil, request_options: {}) + # + # @param video_id [String] The identifier of the video whose media to download. + # + # @param variant [Symbol, OpenAI::Models::VideoDownloadContentParams::Variant] Which downloadable asset to return. Defaults to the MP4 video. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [StringIO] + # + # @see OpenAI::Models::VideoDownloadContentParams + def download_content(video_id, params = {}) + parsed, options = OpenAI::VideoDownloadContentParams.dump_request(params) + @client.request( + method: :get, + path: ["videos/%1$s/content", video_id], + query: parsed, + headers: {"accept" => "application/binary"}, + model: StringIO, + options: options + ) + end + + # Create a video remix + # + # @overload remix(video_id, prompt:, request_options: {}) + # + # @param video_id [String] The identifier of the completed video to remix. + # + # @param prompt [String] Updated text prompt that directs the remix generation. + # + # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [OpenAI::Models::Video] + # + # @see OpenAI::Models::VideoRemixParams + def remix(video_id, params) + parsed, options = OpenAI::VideoRemixParams.dump_request(params) + @client.request( + method: :post, + path: ["videos/%1$s/remix", video_id], + headers: {"content-type" => "multipart/form-data"}, + body: parsed, + model: OpenAI::Video, + options: options + ) + end + + # @api private + # + # @param client [OpenAI::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/rbi/openai/client.rbi b/rbi/openai/client.rbi index 1c7c9a1a..5468cf66 100644 --- a/rbi/openai/client.rbi +++ b/rbi/openai/client.rbi @@ -79,6 +79,9 @@ module OpenAI sig { returns(OpenAI::Resources::Containers) } attr_reader :containers + sig { returns(OpenAI::Resources::Videos) } + attr_reader :videos + # @api private sig { override.returns(T::Hash[String, String]) } private def auth_headers diff --git a/rbi/openai/models.rbi b/rbi/openai/models.rbi index 2d6d93bd..1342db8f 100644 --- a/rbi/openai/models.rbi +++ b/rbi/openai/models.rbi @@ -224,5 +224,27 @@ module OpenAI VectorStoreUpdateParams = OpenAI::Models::VectorStoreUpdateParams + Video = OpenAI::Models::Video + + VideoCreateError = OpenAI::Models::VideoCreateError + + VideoCreateParams = OpenAI::Models::VideoCreateParams + + VideoDeleteParams = OpenAI::Models::VideoDeleteParams + + VideoDownloadContentParams = OpenAI::Models::VideoDownloadContentParams + + VideoListParams = OpenAI::Models::VideoListParams + + VideoModel = OpenAI::Models::VideoModel + + VideoRemixParams = OpenAI::Models::VideoRemixParams + + VideoRetrieveParams = OpenAI::Models::VideoRetrieveParams + + VideoSeconds = OpenAI::Models::VideoSeconds + + VideoSize = OpenAI::Models::VideoSize + Webhooks = OpenAI::Models::Webhooks end diff --git a/rbi/openai/models/all_models.rbi b/rbi/openai/models/all_models.rbi index 5708c46d..cc726cb7 100644 --- a/rbi/openai/models/all_models.rbi +++ b/rbi/openai/models/all_models.rbi @@ -70,6 +70,16 @@ module OpenAI :"gpt-5-codex", OpenAI::AllModels::ResponsesOnlyModel::TaggedSymbol ) + GPT_5_PRO = + T.let( + :"gpt-5-pro", + OpenAI::AllModels::ResponsesOnlyModel::TaggedSymbol + ) + GPT_5_PRO_2025_10_06 = + T.let( + :"gpt-5-pro-2025-10-06", + OpenAI::AllModels::ResponsesOnlyModel::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/openai/models/beta/chatkit/chat_session.rbi b/rbi/openai/models/beta/chatkit/chat_session.rbi new file mode 100644 index 00000000..d14f350f --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session.rbi @@ -0,0 +1,141 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSession < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSession, + OpenAI::Internal::AnyHash + ) + end + + # Identifier for the ChatKit session. + sig { returns(String) } + attr_accessor :id + + # Resolved ChatKit feature configuration for the session. + sig do + returns(OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration) + end + attr_reader :chatkit_configuration + + sig do + params( + chatkit_configuration: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration::OrHash + ).void + end + attr_writer :chatkit_configuration + + # Ephemeral client secret that authenticates session requests. + sig { returns(String) } + attr_accessor :client_secret + + # Unix timestamp (in seconds) for when the session expires. + sig { returns(Integer) } + attr_accessor :expires_at + + # Convenience copy of the per-minute request limit. + sig { returns(Integer) } + attr_accessor :max_requests_per_1_minute + + # Type discriminator that is always `chatkit.session`. + sig { returns(Symbol) } + attr_accessor :object + + # Resolved rate limit values. + sig { returns(OpenAI::Beta::ChatKit::ChatSessionRateLimits) } + attr_reader :rate_limits + + sig do + params( + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits::OrHash + ).void + end + attr_writer :rate_limits + + # Current lifecycle state of the session. + sig do + returns(OpenAI::Beta::ChatKit::ChatSessionStatus::TaggedSymbol) + end + attr_accessor :status + + # User identifier associated with the session. + sig { returns(String) } + attr_accessor :user + + # Workflow metadata for the session. + sig { returns(OpenAI::Beta::ChatKitWorkflow) } + attr_reader :workflow + + sig { params(workflow: OpenAI::Beta::ChatKitWorkflow::OrHash).void } + attr_writer :workflow + + # Represents a ChatKit session and its resolved configuration. + sig do + params( + id: String, + chatkit_configuration: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration::OrHash, + client_secret: String, + expires_at: Integer, + max_requests_per_1_minute: Integer, + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits::OrHash, + status: OpenAI::Beta::ChatKit::ChatSessionStatus::OrSymbol, + user: String, + workflow: OpenAI::Beta::ChatKitWorkflow::OrHash, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + # Identifier for the ChatKit session. + id:, + # Resolved ChatKit feature configuration for the session. + chatkit_configuration:, + # Ephemeral client secret that authenticates session requests. + client_secret:, + # Unix timestamp (in seconds) for when the session expires. + expires_at:, + # Convenience copy of the per-minute request limit. + max_requests_per_1_minute:, + # Resolved rate limit values. + rate_limits:, + # Current lifecycle state of the session. + status:, + # User identifier associated with the session. + user:, + # Workflow metadata for the session. + workflow:, + # Type discriminator that is always `chatkit.session`. + object: :"chatkit.session" + ) + end + + sig do + override.returns( + { + id: String, + chatkit_configuration: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration, + client_secret: String, + expires_at: Integer, + max_requests_per_1_minute: Integer, + object: Symbol, + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits, + status: OpenAI::Beta::ChatKit::ChatSessionStatus::TaggedSymbol, + user: String, + workflow: OpenAI::Beta::ChatKitWorkflow + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbi b/rbi/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbi new file mode 100644 index 00000000..b22fc0d9 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionAutomaticThreadTitling < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling, + OpenAI::Internal::AnyHash + ) + end + + # Whether automatic thread titling is enabled. + sig { returns(T::Boolean) } + attr_accessor :enabled + + # Automatic thread title preferences for the session. + sig { params(enabled: T::Boolean).returns(T.attached_class) } + def self.new( + # Whether automatic thread titling is enabled. + enabled: + ) + end + + sig { override.returns({ enabled: T::Boolean }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbi b/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbi new file mode 100644 index 00000000..911ceb95 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionChatKitConfiguration < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration, + OpenAI::Internal::AnyHash + ) + end + + # Automatic thread titling preferences. + sig do + returns(OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling) + end + attr_reader :automatic_thread_titling + + sig do + params( + automatic_thread_titling: + OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling::OrHash + ).void + end + attr_writer :automatic_thread_titling + + # Upload settings for the session. + sig { returns(OpenAI::Beta::ChatKit::ChatSessionFileUpload) } + attr_reader :file_upload + + sig do + params( + file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload::OrHash + ).void + end + attr_writer :file_upload + + # History retention configuration. + sig { returns(OpenAI::Beta::ChatKit::ChatSessionHistory) } + attr_reader :history + + sig do + params( + history: OpenAI::Beta::ChatKit::ChatSessionHistory::OrHash + ).void + end + attr_writer :history + + # ChatKit configuration for the session. + sig do + params( + automatic_thread_titling: + OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling::OrHash, + file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload::OrHash, + history: OpenAI::Beta::ChatKit::ChatSessionHistory::OrHash + ).returns(T.attached_class) + end + def self.new( + # Automatic thread titling preferences. + automatic_thread_titling:, + # Upload settings for the session. + file_upload:, + # History retention configuration. + history: + ) + end + + sig do + override.returns( + { + automatic_thread_titling: + OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling, + file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload, + history: OpenAI::Beta::ChatKit::ChatSessionHistory + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbi b/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbi new file mode 100644 index 00000000..a6a6c31d --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbi @@ -0,0 +1,256 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionChatKitConfigurationParam < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam, + OpenAI::Internal::AnyHash + ) + end + + # Configuration for automatic thread titling. When omitted, automatic thread + # titling is enabled by default. + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling + ) + ) + end + attr_reader :automatic_thread_titling + + sig do + params( + automatic_thread_titling: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling::OrHash + ).void + end + attr_writer :automatic_thread_titling + + # Configuration for upload enablement and limits. When omitted, uploads are + # disabled by default (max_files 10, max_file_size 512 MB). + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload + ) + ) + end + attr_reader :file_upload + + sig do + params( + file_upload: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload::OrHash + ).void + end + attr_writer :file_upload + + # Configuration for chat history retention. When omitted, history is enabled by + # default with no limit on recent_threads (null). + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History + ) + ) + end + attr_reader :history + + sig do + params( + history: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History::OrHash + ).void + end + attr_writer :history + + # Optional per-session configuration settings for ChatKit behavior. + sig do + params( + automatic_thread_titling: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling::OrHash, + file_upload: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload::OrHash, + history: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History::OrHash + ).returns(T.attached_class) + end + def self.new( + # Configuration for automatic thread titling. When omitted, automatic thread + # titling is enabled by default. + automatic_thread_titling: nil, + # Configuration for upload enablement and limits. When omitted, uploads are + # disabled by default (max_files 10, max_file_size 512 MB). + file_upload: nil, + # Configuration for chat history retention. When omitted, history is enabled by + # default with no limit on recent_threads (null). + history: nil + ) + end + + sig do + override.returns( + { + automatic_thread_titling: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling, + file_upload: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload, + history: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History + } + ) + end + def to_hash + end + + class AutomaticThreadTitling < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling, + OpenAI::Internal::AnyHash + ) + end + + # Enable automatic thread title generation. Defaults to true. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + + sig { params(enabled: T::Boolean).void } + attr_writer :enabled + + # Configuration for automatic thread titling. When omitted, automatic thread + # titling is enabled by default. + sig { params(enabled: T::Boolean).returns(T.attached_class) } + def self.new( + # Enable automatic thread title generation. Defaults to true. + enabled: nil + ) + end + + sig { override.returns({ enabled: T::Boolean }) } + def to_hash + end + end + + class FileUpload < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload, + OpenAI::Internal::AnyHash + ) + end + + # Enable uploads for this session. Defaults to false. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + + sig { params(enabled: T::Boolean).void } + attr_writer :enabled + + # Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is + # the maximum allowable size. + sig { returns(T.nilable(Integer)) } + attr_reader :max_file_size + + sig { params(max_file_size: Integer).void } + attr_writer :max_file_size + + # Maximum number of files that can be uploaded to the session. Defaults to 10. + sig { returns(T.nilable(Integer)) } + attr_reader :max_files + + sig { params(max_files: Integer).void } + attr_writer :max_files + + # Configuration for upload enablement and limits. When omitted, uploads are + # disabled by default (max_files 10, max_file_size 512 MB). + sig do + params( + enabled: T::Boolean, + max_file_size: Integer, + max_files: Integer + ).returns(T.attached_class) + end + def self.new( + # Enable uploads for this session. Defaults to false. + enabled: nil, + # Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is + # the maximum allowable size. + max_file_size: nil, + # Maximum number of files that can be uploaded to the session. Defaults to 10. + max_files: nil + ) + end + + sig do + override.returns( + { + enabled: T::Boolean, + max_file_size: Integer, + max_files: Integer + } + ) + end + def to_hash + end + end + + class History < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History, + OpenAI::Internal::AnyHash + ) + end + + # Enables chat users to access previous ChatKit threads. Defaults to true. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + + sig { params(enabled: T::Boolean).void } + attr_writer :enabled + + # Number of recent ChatKit threads users have access to. Defaults to unlimited + # when unset. + sig { returns(T.nilable(Integer)) } + attr_reader :recent_threads + + sig { params(recent_threads: Integer).void } + attr_writer :recent_threads + + # Configuration for chat history retention. When omitted, history is enabled by + # default with no limit on recent_threads (null). + sig do + params(enabled: T::Boolean, recent_threads: Integer).returns( + T.attached_class + ) + end + def self.new( + # Enables chat users to access previous ChatKit threads. Defaults to true. + enabled: nil, + # Number of recent ChatKit threads users have access to. Defaults to unlimited + # when unset. + recent_threads: nil + ) + end + + sig do + override.returns({ enabled: T::Boolean, recent_threads: Integer }) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_expires_after_param.rbi b/rbi/openai/models/beta/chatkit/chat_session_expires_after_param.rbi new file mode 100644 index 00000000..4b13139a --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_expires_after_param.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionExpiresAfterParam < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam, + OpenAI::Internal::AnyHash + ) + end + + # Base timestamp used to calculate expiration. Currently fixed to `created_at`. + sig { returns(Symbol) } + attr_accessor :anchor + + # Number of seconds after the anchor when the session expires. + sig { returns(Integer) } + attr_accessor :seconds + + # Controls when the session expires relative to an anchor timestamp. + sig do + params(seconds: Integer, anchor: Symbol).returns(T.attached_class) + end + def self.new( + # Number of seconds after the anchor when the session expires. + seconds:, + # Base timestamp used to calculate expiration. Currently fixed to `created_at`. + anchor: :created_at + ) + end + + sig { override.returns({ anchor: Symbol, seconds: Integer }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_file_upload.rbi b/rbi/openai/models/beta/chatkit/chat_session_file_upload.rbi new file mode 100644 index 00000000..a6b5b1ff --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_file_upload.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionFileUpload < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionFileUpload, + OpenAI::Internal::AnyHash + ) + end + + # Indicates if uploads are enabled for the session. + sig { returns(T::Boolean) } + attr_accessor :enabled + + # Maximum upload size in megabytes. + sig { returns(T.nilable(Integer)) } + attr_accessor :max_file_size + + # Maximum number of uploads allowed during the session. + sig { returns(T.nilable(Integer)) } + attr_accessor :max_files + + # Upload permissions and limits applied to the session. + sig do + params( + enabled: T::Boolean, + max_file_size: T.nilable(Integer), + max_files: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # Indicates if uploads are enabled for the session. + enabled:, + # Maximum upload size in megabytes. + max_file_size:, + # Maximum number of uploads allowed during the session. + max_files: + ) + end + + sig do + override.returns( + { + enabled: T::Boolean, + max_file_size: T.nilable(Integer), + max_files: T.nilable(Integer) + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_history.rbi b/rbi/openai/models/beta/chatkit/chat_session_history.rbi new file mode 100644 index 00000000..fb86eef8 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_history.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionHistory < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionHistory, + OpenAI::Internal::AnyHash + ) + end + + # Indicates if chat history is persisted for the session. + sig { returns(T::Boolean) } + attr_accessor :enabled + + # Number of prior threads surfaced in history views. Defaults to null when all + # history is retained. + sig { returns(T.nilable(Integer)) } + attr_accessor :recent_threads + + # History retention preferences returned for the session. + sig do + params( + enabled: T::Boolean, + recent_threads: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # Indicates if chat history is persisted for the session. + enabled:, + # Number of prior threads surfaced in history views. Defaults to null when all + # history is retained. + recent_threads: + ) + end + + sig do + override.returns( + { enabled: T::Boolean, recent_threads: T.nilable(Integer) } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_rate_limits.rbi b/rbi/openai/models/beta/chatkit/chat_session_rate_limits.rbi new file mode 100644 index 00000000..4214c165 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_rate_limits.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionRateLimits < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionRateLimits, + OpenAI::Internal::AnyHash + ) + end + + # Maximum allowed requests per one-minute window. + sig { returns(Integer) } + attr_accessor :max_requests_per_1_minute + + # Active per-minute request limit for the session. + sig do + params(max_requests_per_1_minute: Integer).returns(T.attached_class) + end + def self.new( + # Maximum allowed requests per one-minute window. + max_requests_per_1_minute: + ) + end + + sig { override.returns({ max_requests_per_1_minute: Integer }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_rate_limits_param.rbi b/rbi/openai/models/beta/chatkit/chat_session_rate_limits_param.rbi new file mode 100644 index 00000000..5bfe112b --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_rate_limits_param.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionRateLimitsParam < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam, + OpenAI::Internal::AnyHash + ) + end + + # Maximum number of requests allowed per minute for the session. Defaults to 10. + sig { returns(T.nilable(Integer)) } + attr_reader :max_requests_per_1_minute + + sig { params(max_requests_per_1_minute: Integer).void } + attr_writer :max_requests_per_1_minute + + # Controls request rate limits for the session. + sig do + params(max_requests_per_1_minute: Integer).returns(T.attached_class) + end + def self.new( + # Maximum number of requests allowed per minute for the session. Defaults to 10. + max_requests_per_1_minute: nil + ) + end + + sig { override.returns({ max_requests_per_1_minute: Integer }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_status.rbi b/rbi/openai/models/beta/chatkit/chat_session_status.rbi new file mode 100644 index 00000000..21f9c9f2 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_status.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + module ChatSessionStatus + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Beta::ChatKit::ChatSessionStatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :active, + OpenAI::Beta::ChatKit::ChatSessionStatus::TaggedSymbol + ) + EXPIRED = + T.let( + :expired, + OpenAI::Beta::ChatKit::ChatSessionStatus::TaggedSymbol + ) + CANCELLED = + T.let( + :cancelled, + OpenAI::Beta::ChatKit::ChatSessionStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[OpenAI::Beta::ChatKit::ChatSessionStatus::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chat_session_workflow_param.rbi b/rbi/openai/models/beta/chatkit/chat_session_workflow_param.rbi new file mode 100644 index 00000000..845ce250 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chat_session_workflow_param.rbi @@ -0,0 +1,166 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ChatSessionWorkflowParam < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam, + OpenAI::Internal::AnyHash + ) + end + + # Identifier for the workflow invoked by the session. + sig { returns(String) } + attr_accessor :id + + # State variables forwarded to the workflow. Keys may be up to 64 characters, + # values must be primitive types, and the map defaults to an empty object. + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::StateVariable::Variants + ] + ) + ) + end + attr_reader :state_variables + + sig do + params( + state_variables: + T::Hash[ + Symbol, + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::StateVariable::Variants + ] + ).void + end + attr_writer :state_variables + + # Optional tracing overrides for the workflow invocation. When omitted, tracing is + # enabled by default. + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing + ) + ) + end + attr_reader :tracing + + sig do + params( + tracing: + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing::OrHash + ).void + end + attr_writer :tracing + + # Specific workflow version to run. Defaults to the latest deployed version. + sig { returns(T.nilable(String)) } + attr_reader :version + + sig { params(version: String).void } + attr_writer :version + + # Workflow reference and overrides applied to the chat session. + sig do + params( + id: String, + state_variables: + T::Hash[ + Symbol, + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::StateVariable::Variants + ], + tracing: + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing::OrHash, + version: String + ).returns(T.attached_class) + end + def self.new( + # Identifier for the workflow invoked by the session. + id:, + # State variables forwarded to the workflow. Keys may be up to 64 characters, + # values must be primitive types, and the map defaults to an empty object. + state_variables: nil, + # Optional tracing overrides for the workflow invocation. When omitted, tracing is + # enabled by default. + tracing: nil, + # Specific workflow version to run. Defaults to the latest deployed version. + version: nil + ) + end + + sig do + override.returns( + { + id: String, + state_variables: + T::Hash[ + Symbol, + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::StateVariable::Variants + ], + tracing: + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing, + version: String + } + ) + end + def to_hash + end + + module StateVariable + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { T.any(String, T::Boolean, Float) } + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::StateVariable::Variants + ] + ) + end + def self.variants + end + end + + class Tracing < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing, + OpenAI::Internal::AnyHash + ) + end + + # Whether tracing is enabled during the session. Defaults to true. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + + sig { params(enabled: T::Boolean).void } + attr_writer :enabled + + # Optional tracing overrides for the workflow invocation. When omitted, tracing is + # enabled by default. + sig { params(enabled: T::Boolean).returns(T.attached_class) } + def self.new( + # Whether tracing is enabled during the session. Defaults to true. + enabled: nil + ) + end + + sig { override.returns({ enabled: T::Boolean }) } + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chatkit_attachment.rbi b/rbi/openai/models/beta/chatkit/chatkit_attachment.rbi new file mode 100644 index 00000000..e6418be7 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chatkit_attachment.rbi @@ -0,0 +1,116 @@ +# typed: strong + +module OpenAI + module Models + module Beta + ChatKitAttachment = ChatKit::ChatKitAttachment + + module ChatKit + class ChatKitAttachment < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitAttachment, + OpenAI::Internal::AnyHash + ) + end + + # Identifier for the attachment. + sig { returns(String) } + attr_accessor :id + + # MIME type of the attachment. + sig { returns(String) } + attr_accessor :mime_type + + # Original display name for the attachment. + sig { returns(String) } + attr_accessor :name + + # Preview URL for rendering the attachment inline. + sig { returns(T.nilable(String)) } + attr_accessor :preview_url + + # Attachment discriminator. + sig do + returns( + OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Attachment metadata included on thread items. + sig do + params( + id: String, + mime_type: String, + name: String, + preview_url: T.nilable(String), + type: OpenAI::Beta::ChatKit::ChatKitAttachment::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Identifier for the attachment. + id:, + # MIME type of the attachment. + mime_type:, + # Original display name for the attachment. + name:, + # Preview URL for rendering the attachment inline. + preview_url:, + # Attachment discriminator. + type: + ) + end + + sig do + override.returns( + { + id: String, + mime_type: String, + name: String, + preview_url: T.nilable(String), + type: + OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Attachment discriminator. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Beta::ChatKit::ChatKitAttachment::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGE = + T.let( + :image, + OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol + ) + FILE = + T.let( + :file, + OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chatkit_response_output_text.rbi b/rbi/openai/models/beta/chatkit/chatkit_response_output_text.rbi new file mode 100644 index 00000000..70e4be9d --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chatkit_response_output_text.rbi @@ -0,0 +1,287 @@ +# typed: strong + +module OpenAI + module Models + module Beta + ChatKitResponseOutputText = ChatKit::ChatKitResponseOutputText + + module ChatKit + class ChatKitResponseOutputText < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText, + OpenAI::Internal::AnyHash + ) + end + + # Ordered list of annotations attached to the response text. + sig do + returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::Variants + ] + ) + end + attr_accessor :annotations + + # Assistant generated text. + sig { returns(String) } + attr_accessor :text + + # Type discriminator that is always `output_text`. + sig { returns(Symbol) } + attr_accessor :type + + # Assistant response text accompanied by optional annotations. + sig do + params( + annotations: + T::Array[ + T.any( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::OrHash, + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::OrHash + ) + ], + text: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Ordered list of annotations attached to the response text. + annotations:, + # Assistant generated text. + text:, + # Type discriminator that is always `output_text`. + type: :output_text + ) + end + + sig do + override.returns( + { + annotations: + T::Array[ + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::Variants + ], + text: String, + type: Symbol + } + ) + end + def to_hash + end + + # Annotation object describing a cited source. + module Annotation + extend OpenAI::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File, + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL + ) + end + + class File < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File, + OpenAI::Internal::AnyHash + ) + end + + # File attachment referenced by the annotation. + sig do + returns( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source + ) + end + attr_reader :source + + sig do + params( + source: + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source::OrHash + ).void + end + attr_writer :source + + # Type discriminator that is always `file` for this annotation. + sig { returns(Symbol) } + attr_accessor :type + + # Annotation that references an uploaded file. + sig do + params( + source: + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source::OrHash, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # File attachment referenced by the annotation. + source:, + # Type discriminator that is always `file` for this annotation. + type: :file + ) + end + + sig do + override.returns( + { + source: + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source, + type: Symbol + } + ) + end + def to_hash + end + + class Source < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source, + OpenAI::Internal::AnyHash + ) + end + + # Filename referenced by the annotation. + sig { returns(String) } + attr_accessor :filename + + # Type discriminator that is always `file`. + sig { returns(Symbol) } + attr_accessor :type + + # File attachment referenced by the annotation. + sig do + params(filename: String, type: Symbol).returns( + T.attached_class + ) + end + def self.new( + # Filename referenced by the annotation. + filename:, + # Type discriminator that is always `file`. + type: :file + ) + end + + sig { override.returns({ filename: String, type: Symbol }) } + def to_hash + end + end + end + + class URL < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL, + OpenAI::Internal::AnyHash + ) + end + + # URL referenced by the annotation. + sig do + returns( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source + ) + end + attr_reader :source + + sig do + params( + source: + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source::OrHash + ).void + end + attr_writer :source + + # Type discriminator that is always `url` for this annotation. + sig { returns(Symbol) } + attr_accessor :type + + # Annotation that references a URL. + sig do + params( + source: + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source::OrHash, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # URL referenced by the annotation. + source:, + # Type discriminator that is always `url` for this annotation. + type: :url + ) + end + + sig do + override.returns( + { + source: + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source, + type: Symbol + } + ) + end + def to_hash + end + + class Source < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source, + OpenAI::Internal::AnyHash + ) + end + + # Type discriminator that is always `url`. + sig { returns(Symbol) } + attr_accessor :type + + # URL referenced by the annotation. + sig { returns(String) } + attr_accessor :url + + # URL referenced by the annotation. + sig do + params(url: String, type: Symbol).returns(T.attached_class) + end + def self.new( + # URL referenced by the annotation. + url:, + # Type discriminator that is always `url`. + type: :url + ) + end + + sig { override.returns({ type: Symbol, url: String }) } + def to_hash + end + end + end + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::Variants + ] + ) + end + def self.variants + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chatkit_thread.rbi b/rbi/openai/models/beta/chatkit/chatkit_thread.rbi new file mode 100644 index 00000000..237ee989 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chatkit_thread.rbi @@ -0,0 +1,220 @@ +# typed: strong + +module OpenAI + module Models + module Beta + ChatKitThread = ChatKit::ChatKitThread + + module ChatKit + class ChatKitThread < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThread, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the thread. + sig { returns(String) } + attr_accessor :id + + # Unix timestamp (in seconds) for when the thread was created. + sig { returns(Integer) } + attr_accessor :created_at + + # Type discriminator that is always `chatkit.thread`. + sig { returns(Symbol) } + attr_accessor :object + + # Current status for the thread. Defaults to `active` for newly created threads. + sig do + returns(OpenAI::Beta::ChatKit::ChatKitThread::Status::Variants) + end + attr_accessor :status + + # Optional human-readable title for the thread. Defaults to null when no title has + # been generated. + sig { returns(T.nilable(String)) } + attr_accessor :title + + # Free-form string that identifies your end user who owns the thread. + sig { returns(String) } + attr_accessor :user + + # Represents a ChatKit thread and its current status. + sig do + params( + id: String, + created_at: Integer, + status: + T.any( + OpenAI::Beta::ChatKit::ChatKitThread::Status::Active::OrHash, + OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked::OrHash, + OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed::OrHash + ), + title: T.nilable(String), + user: String, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + # Identifier of the thread. + id:, + # Unix timestamp (in seconds) for when the thread was created. + created_at:, + # Current status for the thread. Defaults to `active` for newly created threads. + status:, + # Optional human-readable title for the thread. Defaults to null when no title has + # been generated. + title:, + # Free-form string that identifies your end user who owns the thread. + user:, + # Type discriminator that is always `chatkit.thread`. + object: :"chatkit.thread" + ) + end + + sig do + override.returns( + { + id: String, + created_at: Integer, + object: Symbol, + status: OpenAI::Beta::ChatKit::ChatKitThread::Status::Variants, + title: T.nilable(String), + user: String + } + ) + end + def to_hash + end + + # Current status for the thread. Defaults to `active` for newly created threads. + module Status + extend OpenAI::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThread::Status::Active, + OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked, + OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed + ) + end + + class Active < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThread::Status::Active, + OpenAI::Internal::AnyHash + ) + end + + # Status discriminator that is always `active`. + sig { returns(Symbol) } + attr_accessor :type + + # Indicates that a thread is active. + sig { params(type: Symbol).returns(T.attached_class) } + def self.new( + # Status discriminator that is always `active`. + type: :active + ) + end + + sig { override.returns({ type: Symbol }) } + def to_hash + end + end + + class Locked < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked, + OpenAI::Internal::AnyHash + ) + end + + # Reason that the thread was locked. Defaults to null when no reason is recorded. + sig { returns(T.nilable(String)) } + attr_accessor :reason + + # Status discriminator that is always `locked`. + sig { returns(Symbol) } + attr_accessor :type + + # Indicates that a thread is locked and cannot accept new input. + sig do + params(reason: T.nilable(String), type: Symbol).returns( + T.attached_class + ) + end + def self.new( + # Reason that the thread was locked. Defaults to null when no reason is recorded. + reason:, + # Status discriminator that is always `locked`. + type: :locked + ) + end + + sig do + override.returns({ reason: T.nilable(String), type: Symbol }) + end + def to_hash + end + end + + class Closed < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed, + OpenAI::Internal::AnyHash + ) + end + + # Reason that the thread was closed. Defaults to null when no reason is recorded. + sig { returns(T.nilable(String)) } + attr_accessor :reason + + # Status discriminator that is always `closed`. + sig { returns(Symbol) } + attr_accessor :type + + # Indicates that a thread has been closed. + sig do + params(reason: T.nilable(String), type: Symbol).returns( + T.attached_class + ) + end + def self.new( + # Reason that the thread was closed. Defaults to null when no reason is recorded. + reason:, + # Status discriminator that is always `closed`. + type: :closed + ) + end + + sig do + override.returns({ reason: T.nilable(String), type: Symbol }) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[OpenAI::Beta::ChatKit::ChatKitThread::Status::Variants] + ) + end + def self.variants + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbi b/rbi/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbi new file mode 100644 index 00000000..c15fc843 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module OpenAI + module Models + module Beta + ChatKitThreadAssistantMessageItem = + ChatKit::ChatKitThreadAssistantMessageItem + + module ChatKit + class ChatKitThreadAssistantMessageItem < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadAssistantMessageItem, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the thread item. + sig { returns(String) } + attr_accessor :id + + # Ordered assistant response segments. + sig do + returns(T::Array[OpenAI::Beta::ChatKit::ChatKitResponseOutputText]) + end + attr_accessor :content + + # Unix timestamp (in seconds) for when the item was created. + sig { returns(Integer) } + attr_accessor :created_at + + # Type discriminator that is always `chatkit.thread_item`. + sig { returns(Symbol) } + attr_accessor :object + + # Identifier of the parent thread. + sig { returns(String) } + attr_accessor :thread_id + + # Type discriminator that is always `chatkit.assistant_message`. + sig { returns(Symbol) } + attr_accessor :type + + # Assistant-authored message within a thread. + sig do + params( + id: String, + content: + T::Array[ + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::OrHash + ], + created_at: Integer, + thread_id: String, + object: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Identifier of the thread item. + id:, + # Ordered assistant response segments. + content:, + # Unix timestamp (in seconds) for when the item was created. + created_at:, + # Identifier of the parent thread. + thread_id:, + # Type discriminator that is always `chatkit.thread_item`. + object: :"chatkit.thread_item", + # Type discriminator that is always `chatkit.assistant_message`. + type: :"chatkit.assistant_message" + ) + end + + sig do + override.returns( + { + id: String, + content: + T::Array[OpenAI::Beta::ChatKit::ChatKitResponseOutputText], + created_at: Integer, + object: Symbol, + thread_id: String, + type: Symbol + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chatkit_thread_item_list.rbi b/rbi/openai/models/beta/chatkit/chatkit_thread_item_list.rbi new file mode 100644 index 00000000..7c7f6210 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chatkit_thread_item_list.rbi @@ -0,0 +1,590 @@ +# typed: strong + +module OpenAI + module Models + module Beta + ChatKitThreadItemList = ChatKit::ChatKitThreadItemList + + module ChatKit + class ChatKitThreadItemList < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadItemList, + OpenAI::Internal::AnyHash + ) + end + + # A list of items + sig do + returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::Variants + ] + ) + end + attr_accessor :data + + # The ID of the first item in the list. + sig { returns(T.nilable(String)) } + attr_accessor :first_id + + # Whether there are more items available. + sig { returns(T::Boolean) } + attr_accessor :has_more + + # The ID of the last item in the list. + sig { returns(T.nilable(String)) } + attr_accessor :last_id + + # The type of object returned, must be `list`. + sig { returns(Symbol) } + attr_accessor :object + + # A paginated list of thread items rendered for the ChatKit API. + sig do + params( + data: + T::Array[ + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::OrHash, + OpenAI::Beta::ChatKit::ChatKitThreadAssistantMessageItem::OrHash, + OpenAI::Beta::ChatKit::ChatKitWidgetItem::OrHash, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::OrHash, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::OrHash, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::OrHash + ) + ], + first_id: T.nilable(String), + has_more: T::Boolean, + last_id: T.nilable(String), + object: Symbol + ).returns(T.attached_class) + end + def self.new( + # A list of items + data:, + # The ID of the first item in the list. + first_id:, + # Whether there are more items available. + has_more:, + # The ID of the last item in the list. + last_id:, + # The type of object returned, must be `list`. + object: :list + ) + end + + sig do + override.returns( + { + data: + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::Variants + ], + first_id: T.nilable(String), + has_more: T::Boolean, + last_id: T.nilable(String), + object: Symbol + } + ) + end + def to_hash + end + + # User-authored messages within a thread. + module Data + extend OpenAI::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem, + OpenAI::Beta::ChatKit::ChatKitThreadAssistantMessageItem, + OpenAI::Beta::ChatKit::ChatKitWidgetItem, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup + ) + end + + class ChatKitClientToolCall < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the thread item. + sig { returns(String) } + attr_accessor :id + + # JSON-encoded arguments that were sent to the tool. + sig { returns(String) } + attr_accessor :arguments + + # Identifier for the client tool call. + sig { returns(String) } + attr_accessor :call_id + + # Unix timestamp (in seconds) for when the item was created. + sig { returns(Integer) } + attr_accessor :created_at + + # Tool name that was invoked. + sig { returns(String) } + attr_accessor :name + + # Type discriminator that is always `chatkit.thread_item`. + sig { returns(Symbol) } + attr_accessor :object + + # JSON-encoded output captured from the tool. Defaults to null while execution is + # in progress. + sig { returns(T.nilable(String)) } + attr_accessor :output + + # Execution status for the tool call. + sig do + returns( + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Identifier of the parent thread. + sig { returns(String) } + attr_accessor :thread_id + + # Type discriminator that is always `chatkit.client_tool_call`. + sig { returns(Symbol) } + attr_accessor :type + + # Record of a client side tool invocation initiated by the assistant. + sig do + params( + id: String, + arguments: String, + call_id: String, + created_at: Integer, + name: String, + output: T.nilable(String), + status: + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status::OrSymbol, + thread_id: String, + object: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Identifier of the thread item. + id:, + # JSON-encoded arguments that were sent to the tool. + arguments:, + # Identifier for the client tool call. + call_id:, + # Unix timestamp (in seconds) for when the item was created. + created_at:, + # Tool name that was invoked. + name:, + # JSON-encoded output captured from the tool. Defaults to null while execution is + # in progress. + output:, + # Execution status for the tool call. + status:, + # Identifier of the parent thread. + thread_id:, + # Type discriminator that is always `chatkit.thread_item`. + object: :"chatkit.thread_item", + # Type discriminator that is always `chatkit.client_tool_call`. + type: :"chatkit.client_tool_call" + ) + end + + sig do + override.returns( + { + id: String, + arguments: String, + call_id: String, + created_at: Integer, + name: String, + object: Symbol, + output: T.nilable(String), + status: + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status::TaggedSymbol, + thread_id: String, + type: Symbol + } + ) + end + def to_hash + end + + # Execution status for the tool call. + module Status + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_PROGRESS = + T.let( + :in_progress, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ChatKitTask < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the thread item. + sig { returns(String) } + attr_accessor :id + + # Unix timestamp (in seconds) for when the item was created. + sig { returns(Integer) } + attr_accessor :created_at + + # Optional heading for the task. Defaults to null when not provided. + sig { returns(T.nilable(String)) } + attr_accessor :heading + + # Type discriminator that is always `chatkit.thread_item`. + sig { returns(Symbol) } + attr_accessor :object + + # Optional summary that describes the task. Defaults to null when omitted. + sig { returns(T.nilable(String)) } + attr_accessor :summary + + # Subtype for the task. + sig do + returns( + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType::TaggedSymbol + ) + end + attr_accessor :task_type + + # Identifier of the parent thread. + sig { returns(String) } + attr_accessor :thread_id + + # Type discriminator that is always `chatkit.task`. + sig { returns(Symbol) } + attr_accessor :type + + # Task emitted by the workflow to show progress and status updates. + sig do + params( + id: String, + created_at: Integer, + heading: T.nilable(String), + summary: T.nilable(String), + task_type: + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType::OrSymbol, + thread_id: String, + object: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Identifier of the thread item. + id:, + # Unix timestamp (in seconds) for when the item was created. + created_at:, + # Optional heading for the task. Defaults to null when not provided. + heading:, + # Optional summary that describes the task. Defaults to null when omitted. + summary:, + # Subtype for the task. + task_type:, + # Identifier of the parent thread. + thread_id:, + # Type discriminator that is always `chatkit.thread_item`. + object: :"chatkit.thread_item", + # Type discriminator that is always `chatkit.task`. + type: :"chatkit.task" + ) + end + + sig do + override.returns( + { + id: String, + created_at: Integer, + heading: T.nilable(String), + object: Symbol, + summary: T.nilable(String), + task_type: + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType::TaggedSymbol, + thread_id: String, + type: Symbol + } + ) + end + def to_hash + end + + # Subtype for the task. + module TaskType + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CUSTOM = + T.let( + :custom, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType::TaggedSymbol + ) + THOUGHT = + T.let( + :thought, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ChatKitTaskGroup < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the thread item. + sig { returns(String) } + attr_accessor :id + + # Unix timestamp (in seconds) for when the item was created. + sig { returns(Integer) } + attr_accessor :created_at + + # Type discriminator that is always `chatkit.thread_item`. + sig { returns(Symbol) } + attr_accessor :object + + # Tasks included in the group. + sig do + returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task + ] + ) + end + attr_accessor :tasks + + # Identifier of the parent thread. + sig { returns(String) } + attr_accessor :thread_id + + # Type discriminator that is always `chatkit.task_group`. + sig { returns(Symbol) } + attr_accessor :type + + # Collection of workflow tasks grouped together in the thread. + sig do + params( + id: String, + created_at: Integer, + tasks: + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::OrHash + ], + thread_id: String, + object: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Identifier of the thread item. + id:, + # Unix timestamp (in seconds) for when the item was created. + created_at:, + # Tasks included in the group. + tasks:, + # Identifier of the parent thread. + thread_id:, + # Type discriminator that is always `chatkit.thread_item`. + object: :"chatkit.thread_item", + # Type discriminator that is always `chatkit.task_group`. + type: :"chatkit.task_group" + ) + end + + sig do + override.returns( + { + id: String, + created_at: Integer, + object: Symbol, + tasks: + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task + ], + thread_id: String, + type: Symbol + } + ) + end + def to_hash + end + + class Task < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task, + OpenAI::Internal::AnyHash + ) + end + + # Optional heading for the grouped task. Defaults to null when not provided. + sig { returns(T.nilable(String)) } + attr_accessor :heading + + # Optional summary that describes the grouped task. Defaults to null when omitted. + sig { returns(T.nilable(String)) } + attr_accessor :summary + + # Subtype for the grouped task. + sig do + returns( + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Task entry that appears within a TaskGroup. + sig do + params( + heading: T.nilable(String), + summary: T.nilable(String), + type: + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Optional heading for the grouped task. Defaults to null when not provided. + heading:, + # Optional summary that describes the grouped task. Defaults to null when omitted. + summary:, + # Subtype for the grouped task. + type: + ) + end + + sig do + override.returns( + { + heading: T.nilable(String), + summary: T.nilable(String), + type: + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Subtype for the grouped task. + module Type + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CUSTOM = + T.let( + :custom, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type::TaggedSymbol + ) + THOUGHT = + T.let( + :thought, + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::Variants + ] + ) + end + def self.variants + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbi b/rbi/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbi new file mode 100644 index 00000000..1fdc5ff1 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbi @@ -0,0 +1,324 @@ +# typed: strong + +module OpenAI + module Models + module Beta + ChatKitThreadUserMessageItem = ChatKit::ChatKitThreadUserMessageItem + + module ChatKit + class ChatKitThreadUserMessageItem < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the thread item. + sig { returns(String) } + attr_accessor :id + + # Attachments associated with the user message. Defaults to an empty list. + sig { returns(T::Array[OpenAI::Beta::ChatKit::ChatKitAttachment]) } + attr_accessor :attachments + + # Ordered content elements supplied by the user. + sig do + returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::Variants + ] + ) + end + attr_accessor :content + + # Unix timestamp (in seconds) for when the item was created. + sig { returns(Integer) } + attr_accessor :created_at + + # Inference overrides applied to the message. Defaults to null when unset. + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions + ) + ) + end + attr_reader :inference_options + + sig do + params( + inference_options: + T.nilable( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::OrHash + ) + ).void + end + attr_writer :inference_options + + # Type discriminator that is always `chatkit.thread_item`. + sig { returns(Symbol) } + attr_accessor :object + + # Identifier of the parent thread. + sig { returns(String) } + attr_accessor :thread_id + + sig { returns(Symbol) } + attr_accessor :type + + # User-authored messages within a thread. + sig do + params( + id: String, + attachments: + T::Array[OpenAI::Beta::ChatKit::ChatKitAttachment::OrHash], + content: + T::Array[ + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText::OrHash, + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText::OrHash + ) + ], + created_at: Integer, + inference_options: + T.nilable( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::OrHash + ), + thread_id: String, + object: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Identifier of the thread item. + id:, + # Attachments associated with the user message. Defaults to an empty list. + attachments:, + # Ordered content elements supplied by the user. + content:, + # Unix timestamp (in seconds) for when the item was created. + created_at:, + # Inference overrides applied to the message. Defaults to null when unset. + inference_options:, + # Identifier of the parent thread. + thread_id:, + # Type discriminator that is always `chatkit.thread_item`. + object: :"chatkit.thread_item", + type: :"chatkit.user_message" + ) + end + + sig do + override.returns( + { + id: String, + attachments: T::Array[OpenAI::Beta::ChatKit::ChatKitAttachment], + content: + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::Variants + ], + created_at: Integer, + inference_options: + T.nilable( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions + ), + object: Symbol, + thread_id: String, + type: Symbol + } + ) + end + def to_hash + end + + # Content blocks that comprise a user message. + module Content + extend OpenAI::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText, + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText + ) + end + + class InputText < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText, + OpenAI::Internal::AnyHash + ) + end + + # Plain-text content supplied by the user. + sig { returns(String) } + attr_accessor :text + + # Type discriminator that is always `input_text`. + sig { returns(Symbol) } + attr_accessor :type + + # Text block that a user contributed to the thread. + sig do + params(text: String, type: Symbol).returns(T.attached_class) + end + def self.new( + # Plain-text content supplied by the user. + text:, + # Type discriminator that is always `input_text`. + type: :input_text + ) + end + + sig { override.returns({ text: String, type: Symbol }) } + def to_hash + end + end + + class QuotedText < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText, + OpenAI::Internal::AnyHash + ) + end + + # Quoted text content. + sig { returns(String) } + attr_accessor :text + + # Type discriminator that is always `quoted_text`. + sig { returns(Symbol) } + attr_accessor :type + + # Quoted snippet that the user referenced in their message. + sig do + params(text: String, type: Symbol).returns(T.attached_class) + end + def self.new( + # Quoted text content. + text:, + # Type discriminator that is always `quoted_text`. + type: :quoted_text + ) + end + + sig { override.returns({ text: String, type: Symbol }) } + def to_hash + end + end + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::Variants + ] + ) + end + def self.variants + end + end + + class InferenceOptions < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions, + OpenAI::Internal::AnyHash + ) + end + + # Model name that generated the response. Defaults to null when using the session + # default. + sig { returns(T.nilable(String)) } + attr_accessor :model + + # Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice + ) + ) + end + attr_reader :tool_choice + + sig do + params( + tool_choice: + T.nilable( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice::OrHash + ) + ).void + end + attr_writer :tool_choice + + # Inference overrides applied to the message. Defaults to null when unset. + sig do + params( + model: T.nilable(String), + tool_choice: + T.nilable( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # Model name that generated the response. Defaults to null when using the session + # default. + model:, + # Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + tool_choice: + ) + end + + sig do + override.returns( + { + model: T.nilable(String), + tool_choice: + T.nilable( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice + ) + } + ) + end + def to_hash + end + + class ToolChoice < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the requested tool. + sig { returns(String) } + attr_accessor :id + + # Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # Identifier of the requested tool. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/chatkit_widget_item.rbi b/rbi/openai/models/beta/chatkit/chatkit_widget_item.rbi new file mode 100644 index 00000000..153a95ea --- /dev/null +++ b/rbi/openai/models/beta/chatkit/chatkit_widget_item.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module OpenAI + module Models + module Beta + ChatKitWidgetItem = ChatKit::ChatKitWidgetItem + + module ChatKit + class ChatKitWidgetItem < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ChatKitWidgetItem, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the thread item. + sig { returns(String) } + attr_accessor :id + + # Unix timestamp (in seconds) for when the item was created. + sig { returns(Integer) } + attr_accessor :created_at + + # Type discriminator that is always `chatkit.thread_item`. + sig { returns(Symbol) } + attr_accessor :object + + # Identifier of the parent thread. + sig { returns(String) } + attr_accessor :thread_id + + # Type discriminator that is always `chatkit.widget`. + sig { returns(Symbol) } + attr_accessor :type + + # Serialized widget payload rendered in the UI. + sig { returns(String) } + attr_accessor :widget + + # Thread item that renders a widget payload. + sig do + params( + id: String, + created_at: Integer, + thread_id: String, + widget: String, + object: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Identifier of the thread item. + id:, + # Unix timestamp (in seconds) for when the item was created. + created_at:, + # Identifier of the parent thread. + thread_id:, + # Serialized widget payload rendered in the UI. + widget:, + # Type discriminator that is always `chatkit.thread_item`. + object: :"chatkit.thread_item", + # Type discriminator that is always `chatkit.widget`. + type: :"chatkit.widget" + ) + end + + sig do + override.returns( + { + id: String, + created_at: Integer, + object: Symbol, + thread_id: String, + type: Symbol, + widget: String + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/session_cancel_params.rbi b/rbi/openai/models/beta/chatkit/session_cancel_params.rbi new file mode 100644 index 00000000..7e8700c4 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/session_cancel_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class SessionCancelParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::SessionCancelParams, + OpenAI::Internal::AnyHash + ) + end + + sig do + params(request_options: OpenAI::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: OpenAI::RequestOptions }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/session_create_params.rbi b/rbi/openai/models/beta/chatkit/session_create_params.rbi new file mode 100644 index 00000000..33f434d6 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/session_create_params.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class SessionCreateParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::SessionCreateParams, + OpenAI::Internal::AnyHash + ) + end + + # A free-form string that identifies your end user; ensures this Session can + # access other objects that have the same `user` scope. + sig { returns(String) } + attr_accessor :user + + # Workflow that powers the session. + sig { returns(OpenAI::Beta::ChatKit::ChatSessionWorkflowParam) } + attr_reader :workflow + + sig do + params( + workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::OrHash + ).void + end + attr_writer :workflow + + # Optional overrides for ChatKit runtime configuration features + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam + ) + ) + end + attr_reader :chatkit_configuration + + sig do + params( + chatkit_configuration: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::OrHash + ).void + end + attr_writer :chatkit_configuration + + # Optional override for session expiration timing in seconds from creation. + # Defaults to 10 minutes. + sig do + returns( + T.nilable(OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam) + ) + end + attr_reader :expires_after + + sig do + params( + expires_after: + OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam::OrHash + ).void + end + attr_writer :expires_after + + # Optional override for per-minute request limits. When omitted, defaults to 10. + sig do + returns( + T.nilable(OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam) + ) + end + attr_reader :rate_limits + + sig do + params( + rate_limits: + OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam::OrHash + ).void + end + attr_writer :rate_limits + + sig do + params( + user: String, + workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::OrHash, + chatkit_configuration: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::OrHash, + expires_after: + OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam::OrHash, + rate_limits: + OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam::OrHash, + request_options: OpenAI::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A free-form string that identifies your end user; ensures this Session can + # access other objects that have the same `user` scope. + user:, + # Workflow that powers the session. + workflow:, + # Optional overrides for ChatKit runtime configuration features + chatkit_configuration: nil, + # Optional override for session expiration timing in seconds from creation. + # Defaults to 10 minutes. + expires_after: nil, + # Optional override for per-minute request limits. When omitted, defaults to 10. + rate_limits: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + user: String, + workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam, + chatkit_configuration: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam, + expires_after: + OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam, + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam, + request_options: OpenAI::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/thread_delete_params.rbi b/rbi/openai/models/beta/chatkit/thread_delete_params.rbi new file mode 100644 index 00000000..1c16c45d --- /dev/null +++ b/rbi/openai/models/beta/chatkit/thread_delete_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ThreadDeleteParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ThreadDeleteParams, + OpenAI::Internal::AnyHash + ) + end + + sig do + params(request_options: OpenAI::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: OpenAI::RequestOptions }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/thread_delete_response.rbi b/rbi/openai/models/beta/chatkit/thread_delete_response.rbi new file mode 100644 index 00000000..f0bf1fce --- /dev/null +++ b/rbi/openai/models/beta/chatkit/thread_delete_response.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ThreadDeleteResponse < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Models::Beta::ChatKit::ThreadDeleteResponse, + OpenAI::Internal::AnyHash + ) + end + + # Identifier of the deleted thread. + sig { returns(String) } + attr_accessor :id + + # Indicates that the thread has been deleted. + sig { returns(T::Boolean) } + attr_accessor :deleted + + # Type discriminator that is always `chatkit.thread.deleted`. + sig { returns(Symbol) } + attr_accessor :object + + # Confirmation payload returned after deleting a thread. + sig do + params(id: String, deleted: T::Boolean, object: Symbol).returns( + T.attached_class + ) + end + def self.new( + # Identifier of the deleted thread. + id:, + # Indicates that the thread has been deleted. + deleted:, + # Type discriminator that is always `chatkit.thread.deleted`. + object: :"chatkit.thread.deleted" + ) + end + + sig do + override.returns( + { id: String, deleted: T::Boolean, object: Symbol } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/thread_list_items_params.rbi b/rbi/openai/models/beta/chatkit/thread_list_items_params.rbi new file mode 100644 index 00000000..07b52c6f --- /dev/null +++ b/rbi/openai/models/beta/chatkit/thread_list_items_params.rbi @@ -0,0 +1,138 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ThreadListItemsParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ThreadListItemsParams, + OpenAI::Internal::AnyHash + ) + end + + # List items created after this thread item ID. Defaults to null for the first + # page. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # List items created before this thread item ID. Defaults to null for the newest + # results. + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Maximum number of thread items to return. Defaults to 20. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Sort order for results by creation time. Defaults to `desc`. + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order::OrSymbol + ) + ) + end + attr_reader :order + + sig do + params( + order: + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order::OrSymbol + ).void + end + attr_writer :order + + sig do + params( + after: String, + before: String, + limit: Integer, + order: + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order::OrSymbol, + request_options: OpenAI::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # List items created after this thread item ID. Defaults to null for the first + # page. + after: nil, + # List items created before this thread item ID. Defaults to null for the newest + # results. + before: nil, + # Maximum number of thread items to return. Defaults to 20. + limit: nil, + # Sort order for results by creation time. Defaults to `desc`. + order: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + after: String, + before: String, + limit: Integer, + order: + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order::OrSymbol, + request_options: OpenAI::RequestOptions + } + ) + end + def to_hash + end + + # Sort order for results by creation time. Defaults to `desc`. + module Order + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let( + :asc, + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order::TaggedSymbol + ) + DESC = + T.let( + :desc, + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/thread_list_params.rbi b/rbi/openai/models/beta/chatkit/thread_list_params.rbi new file mode 100644 index 00000000..4af89127 --- /dev/null +++ b/rbi/openai/models/beta/chatkit/thread_list_params.rbi @@ -0,0 +1,145 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ThreadListParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ThreadListParams, + OpenAI::Internal::AnyHash + ) + end + + # List items created after this thread item ID. Defaults to null for the first + # page. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # List items created before this thread item ID. Defaults to null for the newest + # results. + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Maximum number of thread items to return. Defaults to 20. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Sort order for results by creation time. Defaults to `desc`. + sig do + returns( + T.nilable( + OpenAI::Beta::ChatKit::ThreadListParams::Order::OrSymbol + ) + ) + end + attr_reader :order + + sig do + params( + order: OpenAI::Beta::ChatKit::ThreadListParams::Order::OrSymbol + ).void + end + attr_writer :order + + # Filter threads that belong to this user identifier. Defaults to null to return + # all users. + sig { returns(T.nilable(String)) } + attr_reader :user + + sig { params(user: String).void } + attr_writer :user + + sig do + params( + after: String, + before: String, + limit: Integer, + order: OpenAI::Beta::ChatKit::ThreadListParams::Order::OrSymbol, + user: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # List items created after this thread item ID. Defaults to null for the first + # page. + after: nil, + # List items created before this thread item ID. Defaults to null for the newest + # results. + before: nil, + # Maximum number of thread items to return. Defaults to 20. + limit: nil, + # Sort order for results by creation time. Defaults to `desc`. + order: nil, + # Filter threads that belong to this user identifier. Defaults to null to return + # all users. + user: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + after: String, + before: String, + limit: Integer, + order: OpenAI::Beta::ChatKit::ThreadListParams::Order::OrSymbol, + user: String, + request_options: OpenAI::RequestOptions + } + ) + end + def to_hash + end + + # Sort order for results by creation time. Defaults to `desc`. + module Order + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Beta::ChatKit::ThreadListParams::Order) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = + T.let( + :asc, + OpenAI::Beta::ChatKit::ThreadListParams::Order::TaggedSymbol + ) + DESC = + T.let( + :desc, + OpenAI::Beta::ChatKit::ThreadListParams::Order::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Beta::ChatKit::ThreadListParams::Order::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit/thread_retrieve_params.rbi b/rbi/openai/models/beta/chatkit/thread_retrieve_params.rbi new file mode 100644 index 00000000..a2e65e5f --- /dev/null +++ b/rbi/openai/models/beta/chatkit/thread_retrieve_params.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module OpenAI + module Models + module Beta + module ChatKit + class ThreadRetrieveParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKit::ThreadRetrieveParams, + OpenAI::Internal::AnyHash + ) + end + + sig do + params(request_options: OpenAI::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: OpenAI::RequestOptions }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit_upload_file_params.rbi b/rbi/openai/models/beta/chatkit_upload_file_params.rbi new file mode 100644 index 00000000..20a49467 --- /dev/null +++ b/rbi/openai/models/beta/chatkit_upload_file_params.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module OpenAI + module Models + module Beta + class ChatKitUploadFileParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKitUploadFileParams, + OpenAI::Internal::AnyHash + ) + end + + # Binary file contents to store with the ChatKit session. Supports PDFs and PNG, + # JPG, JPEG, GIF, or WEBP images. + sig { returns(OpenAI::Internal::FileInput) } + attr_accessor :file + + sig do + params( + file: OpenAI::Internal::FileInput, + request_options: OpenAI::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Binary file contents to store with the ChatKit session. Supports PDFs and PNG, + # JPG, JPEG, GIF, or WEBP images. + file:, + request_options: {} + ) + end + + sig do + override.returns( + { + file: OpenAI::Internal::FileInput, + request_options: OpenAI::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit_upload_file_response.rbi b/rbi/openai/models/beta/chatkit_upload_file_response.rbi new file mode 100644 index 00000000..bbac302f --- /dev/null +++ b/rbi/openai/models/beta/chatkit_upload_file_response.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module OpenAI + module Models + module Beta + # Represents either a file or image attachment. + module ChatKitUploadFileResponse + extend OpenAI::Internal::Type::Union + + Variants = + T.type_alias do + T.any(OpenAI::Beta::FilePart, OpenAI::Beta::ImagePart) + end + + sig do + override.returns( + T::Array[OpenAI::Models::Beta::ChatKitUploadFileResponse::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/openai/models/beta/chatkit_workflow.rbi b/rbi/openai/models/beta/chatkit_workflow.rbi new file mode 100644 index 00000000..3e9ee515 --- /dev/null +++ b/rbi/openai/models/beta/chatkit_workflow.rbi @@ -0,0 +1,134 @@ +# typed: strong + +module OpenAI + module Models + module Beta + class ChatKitWorkflow < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(OpenAI::Beta::ChatKitWorkflow, OpenAI::Internal::AnyHash) + end + + # Identifier of the workflow backing the session. + sig { returns(String) } + attr_accessor :id + + # State variable key-value pairs applied when invoking the workflow. Defaults to + # null when no overrides were provided. + sig do + returns( + T.nilable( + T::Hash[ + Symbol, + OpenAI::Beta::ChatKitWorkflow::StateVariable::Variants + ] + ) + ) + end + attr_accessor :state_variables + + # Tracing settings applied to the workflow. + sig { returns(OpenAI::Beta::ChatKitWorkflow::Tracing) } + attr_reader :tracing + + sig do + params(tracing: OpenAI::Beta::ChatKitWorkflow::Tracing::OrHash).void + end + attr_writer :tracing + + # Specific workflow version used for the session. Defaults to null when using the + # latest deployment. + sig { returns(T.nilable(String)) } + attr_accessor :version + + # Workflow metadata and state returned for the session. + sig do + params( + id: String, + state_variables: + T.nilable( + T::Hash[ + Symbol, + OpenAI::Beta::ChatKitWorkflow::StateVariable::Variants + ] + ), + tracing: OpenAI::Beta::ChatKitWorkflow::Tracing::OrHash, + version: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Identifier of the workflow backing the session. + id:, + # State variable key-value pairs applied when invoking the workflow. Defaults to + # null when no overrides were provided. + state_variables:, + # Tracing settings applied to the workflow. + tracing:, + # Specific workflow version used for the session. Defaults to null when using the + # latest deployment. + version: + ) + end + + sig do + override.returns( + { + id: String, + state_variables: + T.nilable( + T::Hash[ + Symbol, + OpenAI::Beta::ChatKitWorkflow::StateVariable::Variants + ] + ), + tracing: OpenAI::Beta::ChatKitWorkflow::Tracing, + version: T.nilable(String) + } + ) + end + def to_hash + end + + module StateVariable + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { T.any(String, T::Boolean, Float) } + + sig do + override.returns( + T::Array[OpenAI::Beta::ChatKitWorkflow::StateVariable::Variants] + ) + end + def self.variants + end + end + + class Tracing < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + OpenAI::Beta::ChatKitWorkflow::Tracing, + OpenAI::Internal::AnyHash + ) + end + + # Indicates whether tracing is enabled. + sig { returns(T::Boolean) } + attr_accessor :enabled + + # Tracing settings applied to the workflow. + sig { params(enabled: T::Boolean).returns(T.attached_class) } + def self.new( + # Indicates whether tracing is enabled. + enabled: + ) + end + + sig { override.returns({ enabled: T::Boolean }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/openai/models/beta/file_part.rbi b/rbi/openai/models/beta/file_part.rbi new file mode 100644 index 00000000..3a93a6e6 --- /dev/null +++ b/rbi/openai/models/beta/file_part.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module OpenAI + module Models + module Beta + class FilePart < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(OpenAI::Beta::FilePart, OpenAI::Internal::AnyHash) + end + + # Unique identifier for the uploaded file. + sig { returns(String) } + attr_accessor :id + + # MIME type reported for the uploaded file. Defaults to null when unknown. + sig { returns(T.nilable(String)) } + attr_accessor :mime_type + + # Original filename supplied by the uploader. Defaults to null when unnamed. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Type discriminator that is always `file`. + sig { returns(Symbol) } + attr_accessor :type + + # Signed URL for downloading the uploaded file. Defaults to null when no download + # link is available. + sig { returns(T.nilable(String)) } + attr_accessor :upload_url + + # Metadata for a non-image file uploaded through ChatKit. + sig do + params( + id: String, + mime_type: T.nilable(String), + name: T.nilable(String), + upload_url: T.nilable(String), + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the uploaded file. + id:, + # MIME type reported for the uploaded file. Defaults to null when unknown. + mime_type:, + # Original filename supplied by the uploader. Defaults to null when unnamed. + name:, + # Signed URL for downloading the uploaded file. Defaults to null when no download + # link is available. + upload_url:, + # Type discriminator that is always `file`. + type: :file + ) + end + + sig do + override.returns( + { + id: String, + mime_type: T.nilable(String), + name: T.nilable(String), + type: Symbol, + upload_url: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/openai/models/beta/image_part.rbi b/rbi/openai/models/beta/image_part.rbi new file mode 100644 index 00000000..b6c5cf1e --- /dev/null +++ b/rbi/openai/models/beta/image_part.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module OpenAI + module Models + module Beta + class ImagePart < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(OpenAI::Beta::ImagePart, OpenAI::Internal::AnyHash) + end + + # Unique identifier for the uploaded image. + sig { returns(String) } + attr_accessor :id + + # MIME type of the uploaded image. + sig { returns(String) } + attr_accessor :mime_type + + # Original filename for the uploaded image. Defaults to null when unnamed. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Preview URL that can be rendered inline for the image. + sig { returns(String) } + attr_accessor :preview_url + + # Type discriminator that is always `image`. + sig { returns(Symbol) } + attr_accessor :type + + # Signed URL for downloading the uploaded image. Defaults to null when no download + # link is available. + sig { returns(T.nilable(String)) } + attr_accessor :upload_url + + # Metadata for an image uploaded through ChatKit. + sig do + params( + id: String, + mime_type: String, + name: T.nilable(String), + preview_url: String, + upload_url: T.nilable(String), + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the uploaded image. + id:, + # MIME type of the uploaded image. + mime_type:, + # Original filename for the uploaded image. Defaults to null when unnamed. + name:, + # Preview URL that can be rendered inline for the image. + preview_url:, + # Signed URL for downloading the uploaded image. Defaults to null when no download + # link is available. + upload_url:, + # Type discriminator that is always `image`. + type: :image + ) + end + + sig do + override.returns( + { + id: String, + mime_type: String, + name: T.nilable(String), + preview_url: String, + type: Symbol, + upload_url: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/openai/models/image_edit_params.rbi b/rbi/openai/models/image_edit_params.rbi index 742bab15..43d7996c 100644 --- a/rbi/openai/models/image_edit_params.rbi +++ b/rbi/openai/models/image_edit_params.rbi @@ -38,7 +38,8 @@ module OpenAI # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. sig do returns(T.nilable(OpenAI::ImageEditParams::InputFidelity::OrSymbol)) end @@ -161,7 +162,8 @@ module OpenAI background: nil, # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. input_fidelity: nil, # An additional image whose fully transparent areas (e.g. where alpha is zero) # indicate where `image` should be edited. If there are multiple images provided, @@ -294,7 +296,8 @@ module OpenAI # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. module InputFidelity extend OpenAI::Internal::Type::Enum diff --git a/rbi/openai/models/image_model.rbi b/rbi/openai/models/image_model.rbi index dabb10a7..d9f76bb9 100644 --- a/rbi/openai/models/image_model.rbi +++ b/rbi/openai/models/image_model.rbi @@ -11,6 +11,8 @@ module OpenAI DALL_E_2 = T.let(:"dall-e-2", OpenAI::ImageModel::TaggedSymbol) DALL_E_3 = T.let(:"dall-e-3", OpenAI::ImageModel::TaggedSymbol) GPT_IMAGE_1 = T.let(:"gpt-image-1", OpenAI::ImageModel::TaggedSymbol) + GPT_IMAGE_1_MINI = + T.let(:"gpt-image-1-mini", OpenAI::ImageModel::TaggedSymbol) sig { override.returns(T::Array[OpenAI::ImageModel::TaggedSymbol]) } def self.values diff --git a/rbi/openai/models/realtime/realtime_session.rbi b/rbi/openai/models/realtime/realtime_session.rbi index e305375c..290a7086 100644 --- a/rbi/openai/models/realtime/realtime_session.rbi +++ b/rbi/openai/models/realtime/realtime_session.rbi @@ -707,6 +707,26 @@ module OpenAI :"gpt-4o-mini-realtime-preview-2024-12-17", OpenAI::Realtime::RealtimeSession::Model::TaggedSymbol ) + GPT_REALTIME_MINI = + T.let( + :"gpt-realtime-mini", + OpenAI::Realtime::RealtimeSession::Model::TaggedSymbol + ) + GPT_REALTIME_MINI_2025_10_06 = + T.let( + :"gpt-realtime-mini-2025-10-06", + OpenAI::Realtime::RealtimeSession::Model::TaggedSymbol + ) + GPT_AUDIO_MINI = + T.let( + :"gpt-audio-mini", + OpenAI::Realtime::RealtimeSession::Model::TaggedSymbol + ) + GPT_AUDIO_MINI_2025_10_06 = + T.let( + :"gpt-audio-mini-2025-10-06", + OpenAI::Realtime::RealtimeSession::Model::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/openai/models/realtime/realtime_session_create_request.rbi b/rbi/openai/models/realtime/realtime_session_create_request.rbi index ef235540..741c73d8 100644 --- a/rbi/openai/models/realtime/realtime_session_create_request.rbi +++ b/rbi/openai/models/realtime/realtime_session_create_request.rbi @@ -508,6 +508,26 @@ module OpenAI :"gpt-4o-mini-realtime-preview-2024-12-17", OpenAI::Realtime::RealtimeSessionCreateRequest::Model::TaggedSymbol ) + GPT_REALTIME_MINI = + T.let( + :"gpt-realtime-mini", + OpenAI::Realtime::RealtimeSessionCreateRequest::Model::TaggedSymbol + ) + GPT_REALTIME_MINI_2025_10_06 = + T.let( + :"gpt-realtime-mini-2025-10-06", + OpenAI::Realtime::RealtimeSessionCreateRequest::Model::TaggedSymbol + ) + GPT_AUDIO_MINI = + T.let( + :"gpt-audio-mini", + OpenAI::Realtime::RealtimeSessionCreateRequest::Model::TaggedSymbol + ) + GPT_AUDIO_MINI_2025_10_06 = + T.let( + :"gpt-audio-mini-2025-10-06", + OpenAI::Realtime::RealtimeSessionCreateRequest::Model::TaggedSymbol + ) end module OutputModality diff --git a/rbi/openai/models/realtime/realtime_session_create_response.rbi b/rbi/openai/models/realtime/realtime_session_create_response.rbi index 6cca5872..73f36107 100644 --- a/rbi/openai/models/realtime/realtime_session_create_response.rbi +++ b/rbi/openai/models/realtime/realtime_session_create_response.rbi @@ -1308,6 +1308,26 @@ module OpenAI :"gpt-4o-mini-realtime-preview-2024-12-17", OpenAI::Realtime::RealtimeSessionCreateResponse::Model::TaggedSymbol ) + GPT_REALTIME_MINI = + T.let( + :"gpt-realtime-mini", + OpenAI::Realtime::RealtimeSessionCreateResponse::Model::TaggedSymbol + ) + GPT_REALTIME_MINI_2025_10_06 = + T.let( + :"gpt-realtime-mini-2025-10-06", + OpenAI::Realtime::RealtimeSessionCreateResponse::Model::TaggedSymbol + ) + GPT_AUDIO_MINI = + T.let( + :"gpt-audio-mini", + OpenAI::Realtime::RealtimeSessionCreateResponse::Model::TaggedSymbol + ) + GPT_AUDIO_MINI_2025_10_06 = + T.let( + :"gpt-audio-mini-2025-10-06", + OpenAI::Realtime::RealtimeSessionCreateResponse::Model::TaggedSymbol + ) end module OutputModality diff --git a/rbi/openai/models/responses/tool.rbi b/rbi/openai/models/responses/tool.rbi index cf4ad532..206960fb 100644 --- a/rbi/openai/models/responses/tool.rbi +++ b/rbi/openai/models/responses/tool.rbi @@ -781,7 +781,8 @@ module OpenAI # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. sig do returns( T.nilable( @@ -946,7 +947,8 @@ module OpenAI background: nil, # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. input_fidelity: nil, # Optional mask for inpainting. Contains `image_url` (string, optional) and # `file_id` (string, optional). @@ -1046,7 +1048,8 @@ module OpenAI # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. module InputFidelity extend OpenAI::Internal::Type::Enum @@ -1139,6 +1142,11 @@ module OpenAI :"gpt-image-1", OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol ) + GPT_IMAGE_1_MINI = + T.let( + :"gpt-image-1-mini", + OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/openai/models/responses_model.rbi b/rbi/openai/models/responses_model.rbi index 0527d58f..de06e9d7 100644 --- a/rbi/openai/models/responses_model.rbi +++ b/rbi/openai/models/responses_model.rbi @@ -78,6 +78,16 @@ module OpenAI :"gpt-5-codex", OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol ) + GPT_5_PRO = + T.let( + :"gpt-5-pro", + OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol + ) + GPT_5_PRO_2025_10_06 = + T.let( + :"gpt-5-pro-2025-10-06", + OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/openai/models/video.rbi b/rbi/openai/models/video.rbi new file mode 100644 index 00000000..096195d6 --- /dev/null +++ b/rbi/openai/models/video.rbi @@ -0,0 +1,143 @@ +# typed: strong + +module OpenAI + module Models + class Video < OpenAI::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(OpenAI::Video, OpenAI::Internal::AnyHash) } + + # Unique identifier for the video job. + sig { returns(String) } + attr_accessor :id + + # Unix timestamp (seconds) for when the job completed, if finished. + sig { returns(T.nilable(Integer)) } + attr_accessor :completed_at + + # Unix timestamp (seconds) for when the job was created. + sig { returns(Integer) } + attr_accessor :created_at + + # Error payload that explains why generation failed, if applicable. + sig { returns(T.nilable(OpenAI::VideoCreateError)) } + attr_reader :error + + sig { params(error: T.nilable(OpenAI::VideoCreateError::OrHash)).void } + attr_writer :error + + # Unix timestamp (seconds) for when the downloadable assets expire, if set. + sig { returns(T.nilable(Integer)) } + attr_accessor :expires_at + + # The video generation model that produced the job. + sig { returns(OpenAI::VideoModel::TaggedSymbol) } + attr_accessor :model + + # The object type, which is always `video`. + sig { returns(Symbol) } + attr_accessor :object + + # Approximate completion percentage for the generation task. + sig { returns(Integer) } + attr_accessor :progress + + # Identifier of the source video if this video is a remix. + sig { returns(T.nilable(String)) } + attr_accessor :remixed_from_video_id + + # Duration of the generated clip in seconds. + sig { returns(OpenAI::VideoSeconds::TaggedSymbol) } + attr_accessor :seconds + + # The resolution of the generated video. + sig { returns(OpenAI::VideoSize::TaggedSymbol) } + attr_accessor :size + + # Current lifecycle status of the video job. + sig { returns(OpenAI::Video::Status::TaggedSymbol) } + attr_accessor :status + + # Structured information describing a generated video job. + sig do + params( + id: String, + completed_at: T.nilable(Integer), + created_at: Integer, + error: T.nilable(OpenAI::VideoCreateError::OrHash), + expires_at: T.nilable(Integer), + model: OpenAI::VideoModel::OrSymbol, + progress: Integer, + remixed_from_video_id: T.nilable(String), + seconds: OpenAI::VideoSeconds::OrSymbol, + size: OpenAI::VideoSize::OrSymbol, + status: OpenAI::Video::Status::OrSymbol, + object: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the video job. + id:, + # Unix timestamp (seconds) for when the job completed, if finished. + completed_at:, + # Unix timestamp (seconds) for when the job was created. + created_at:, + # Error payload that explains why generation failed, if applicable. + error:, + # Unix timestamp (seconds) for when the downloadable assets expire, if set. + expires_at:, + # The video generation model that produced the job. + model:, + # Approximate completion percentage for the generation task. + progress:, + # Identifier of the source video if this video is a remix. + remixed_from_video_id:, + # Duration of the generated clip in seconds. + seconds:, + # The resolution of the generated video. + size:, + # Current lifecycle status of the video job. + status:, + # The object type, which is always `video`. + object: :video + ) + end + + sig do + override.returns( + { + id: String, + completed_at: T.nilable(Integer), + created_at: Integer, + error: T.nilable(OpenAI::VideoCreateError), + expires_at: T.nilable(Integer), + model: OpenAI::VideoModel::TaggedSymbol, + object: Symbol, + progress: Integer, + remixed_from_video_id: T.nilable(String), + seconds: OpenAI::VideoSeconds::TaggedSymbol, + size: OpenAI::VideoSize::TaggedSymbol, + status: OpenAI::Video::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # Current lifecycle status of the video job. + module Status + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Video::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + QUEUED = T.let(:queued, OpenAI::Video::Status::TaggedSymbol) + IN_PROGRESS = T.let(:in_progress, OpenAI::Video::Status::TaggedSymbol) + COMPLETED = T.let(:completed, OpenAI::Video::Status::TaggedSymbol) + FAILED = T.let(:failed, OpenAI::Video::Status::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::Video::Status::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/openai/models/video_create_error.rbi b/rbi/openai/models/video_create_error.rbi new file mode 100644 index 00000000..e692b6d6 --- /dev/null +++ b/rbi/openai/models/video_create_error.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module OpenAI + module Models + class VideoCreateError < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(OpenAI::VideoCreateError, OpenAI::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :message + + sig { params(code: String, message: String).returns(T.attached_class) } + def self.new(code:, message:) + end + + sig { override.returns({ code: String, message: String }) } + def to_hash + end + end + end +end diff --git a/rbi/openai/models/video_create_params.rbi b/rbi/openai/models/video_create_params.rbi new file mode 100644 index 00000000..78241b8d --- /dev/null +++ b/rbi/openai/models/video_create_params.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module OpenAI + module Models + class VideoCreateParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(OpenAI::VideoCreateParams, OpenAI::Internal::AnyHash) + end + + # Text prompt that describes the video to generate. + sig { returns(String) } + attr_accessor :prompt + + # Optional image reference that guides generation. + sig { returns(T.nilable(OpenAI::Internal::FileInput)) } + attr_reader :input_reference + + sig { params(input_reference: OpenAI::Internal::FileInput).void } + attr_writer :input_reference + + # The video generation model to use. Defaults to `sora-2`. + sig { returns(T.nilable(OpenAI::VideoModel::OrSymbol)) } + attr_reader :model + + sig { params(model: OpenAI::VideoModel::OrSymbol).void } + attr_writer :model + + # Clip duration in seconds. Defaults to 4 seconds. + sig { returns(T.nilable(OpenAI::VideoSeconds::OrSymbol)) } + attr_reader :seconds + + sig { params(seconds: OpenAI::VideoSeconds::OrSymbol).void } + attr_writer :seconds + + # Output resolution formatted as width x height. Defaults to 720x1280. + sig { returns(T.nilable(OpenAI::VideoSize::OrSymbol)) } + attr_reader :size + + sig { params(size: OpenAI::VideoSize::OrSymbol).void } + attr_writer :size + + sig do + params( + prompt: String, + input_reference: OpenAI::Internal::FileInput, + model: OpenAI::VideoModel::OrSymbol, + seconds: OpenAI::VideoSeconds::OrSymbol, + size: OpenAI::VideoSize::OrSymbol, + request_options: OpenAI::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Text prompt that describes the video to generate. + prompt:, + # Optional image reference that guides generation. + input_reference: nil, + # The video generation model to use. Defaults to `sora-2`. + model: nil, + # Clip duration in seconds. Defaults to 4 seconds. + seconds: nil, + # Output resolution formatted as width x height. Defaults to 720x1280. + size: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + prompt: String, + input_reference: OpenAI::Internal::FileInput, + model: OpenAI::VideoModel::OrSymbol, + seconds: OpenAI::VideoSeconds::OrSymbol, + size: OpenAI::VideoSize::OrSymbol, + request_options: OpenAI::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/openai/models/video_delete_params.rbi b/rbi/openai/models/video_delete_params.rbi new file mode 100644 index 00000000..9ef13700 --- /dev/null +++ b/rbi/openai/models/video_delete_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module OpenAI + module Models + class VideoDeleteParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(OpenAI::VideoDeleteParams, OpenAI::Internal::AnyHash) + end + + sig do + params(request_options: OpenAI::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: OpenAI::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/openai/models/video_delete_response.rbi b/rbi/openai/models/video_delete_response.rbi new file mode 100644 index 00000000..71791cdf --- /dev/null +++ b/rbi/openai/models/video_delete_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module OpenAI + module Models + class VideoDeleteResponse < OpenAI::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(OpenAI::Models::VideoDeleteResponse, OpenAI::Internal::AnyHash) + end + + # Identifier of the deleted video. + sig { returns(String) } + attr_accessor :id + + # Indicates that the video resource was deleted. + sig { returns(T::Boolean) } + attr_accessor :deleted + + # The object type that signals the deletion response. + sig { returns(Symbol) } + attr_accessor :object + + # Confirmation payload returned after deleting a video. + sig do + params(id: String, deleted: T::Boolean, object: Symbol).returns( + T.attached_class + ) + end + def self.new( + # Identifier of the deleted video. + id:, + # Indicates that the video resource was deleted. + deleted:, + # The object type that signals the deletion response. + object: :"video.deleted" + ) + end + + sig do + override.returns({ id: String, deleted: T::Boolean, object: Symbol }) + end + def to_hash + end + end + end +end diff --git a/rbi/openai/models/video_download_content_params.rbi b/rbi/openai/models/video_download_content_params.rbi new file mode 100644 index 00000000..873e6ee5 --- /dev/null +++ b/rbi/openai/models/video_download_content_params.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module OpenAI + module Models + class VideoDownloadContentParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(OpenAI::VideoDownloadContentParams, OpenAI::Internal::AnyHash) + end + + # Which downloadable asset to return. Defaults to the MP4 video. + sig do + returns( + T.nilable(OpenAI::VideoDownloadContentParams::Variant::OrSymbol) + ) + end + attr_reader :variant + + sig do + params( + variant: OpenAI::VideoDownloadContentParams::Variant::OrSymbol + ).void + end + attr_writer :variant + + sig do + params( + variant: OpenAI::VideoDownloadContentParams::Variant::OrSymbol, + request_options: OpenAI::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Which downloadable asset to return. Defaults to the MP4 video. + variant: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + variant: OpenAI::VideoDownloadContentParams::Variant::OrSymbol, + request_options: OpenAI::RequestOptions + } + ) + end + def to_hash + end + + # Which downloadable asset to return. Defaults to the MP4 video. + module Variant + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::VideoDownloadContentParams::Variant) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIDEO = + T.let( + :video, + OpenAI::VideoDownloadContentParams::Variant::TaggedSymbol + ) + THUMBNAIL = + T.let( + :thumbnail, + OpenAI::VideoDownloadContentParams::Variant::TaggedSymbol + ) + SPRITESHEET = + T.let( + :spritesheet, + OpenAI::VideoDownloadContentParams::Variant::TaggedSymbol + ) + + sig do + override.returns( + T::Array[OpenAI::VideoDownloadContentParams::Variant::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/openai/models/video_list_params.rbi b/rbi/openai/models/video_list_params.rbi new file mode 100644 index 00000000..08f2eb11 --- /dev/null +++ b/rbi/openai/models/video_list_params.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module OpenAI + module Models + class VideoListParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(OpenAI::VideoListParams, OpenAI::Internal::AnyHash) + end + + # Identifier for the last item from the previous pagination request + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # Number of items to retrieve + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Sort order of results by timestamp. Use `asc` for ascending order or `desc` for + # descending order. + sig { returns(T.nilable(OpenAI::VideoListParams::Order::OrSymbol)) } + attr_reader :order + + sig { params(order: OpenAI::VideoListParams::Order::OrSymbol).void } + attr_writer :order + + sig do + params( + after: String, + limit: Integer, + order: OpenAI::VideoListParams::Order::OrSymbol, + request_options: OpenAI::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Identifier for the last item from the previous pagination request + after: nil, + # Number of items to retrieve + limit: nil, + # Sort order of results by timestamp. Use `asc` for ascending order or `desc` for + # descending order. + order: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + after: String, + limit: Integer, + order: OpenAI::VideoListParams::Order::OrSymbol, + request_options: OpenAI::RequestOptions + } + ) + end + def to_hash + end + + # Sort order of results by timestamp. Use `asc` for ascending order or `desc` for + # descending order. + module Order + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, OpenAI::VideoListParams::Order) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ASC = T.let(:asc, OpenAI::VideoListParams::Order::TaggedSymbol) + DESC = T.let(:desc, OpenAI::VideoListParams::Order::TaggedSymbol) + + sig do + override.returns( + T::Array[OpenAI::VideoListParams::Order::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/openai/models/video_model.rbi b/rbi/openai/models/video_model.rbi new file mode 100644 index 00000000..39c36b1c --- /dev/null +++ b/rbi/openai/models/video_model.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module OpenAI + module Models + module VideoModel + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::VideoModel) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SORA_2 = T.let(:"sora-2", OpenAI::VideoModel::TaggedSymbol) + SORA_2_PRO = T.let(:"sora-2-pro", OpenAI::VideoModel::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::VideoModel::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/openai/models/video_remix_params.rbi b/rbi/openai/models/video_remix_params.rbi new file mode 100644 index 00000000..bc5c0617 --- /dev/null +++ b/rbi/openai/models/video_remix_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module OpenAI + module Models + class VideoRemixParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(OpenAI::VideoRemixParams, OpenAI::Internal::AnyHash) + end + + # Updated text prompt that directs the remix generation. + sig { returns(String) } + attr_accessor :prompt + + sig do + params( + prompt: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Updated text prompt that directs the remix generation. + prompt:, + request_options: {} + ) + end + + sig do + override.returns( + { prompt: String, request_options: OpenAI::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/openai/models/video_retrieve_params.rbi b/rbi/openai/models/video_retrieve_params.rbi new file mode 100644 index 00000000..9cab30bb --- /dev/null +++ b/rbi/openai/models/video_retrieve_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module OpenAI + module Models + class VideoRetrieveParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(OpenAI::VideoRetrieveParams, OpenAI::Internal::AnyHash) + end + + sig do + params(request_options: OpenAI::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: OpenAI::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/openai/models/video_seconds.rbi b/rbi/openai/models/video_seconds.rbi new file mode 100644 index 00000000..f0b588e8 --- /dev/null +++ b/rbi/openai/models/video_seconds.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module OpenAI + module Models + module VideoSeconds + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::VideoSeconds) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIDEO_SECONDS_4 = T.let(:"4", OpenAI::VideoSeconds::TaggedSymbol) + VIDEO_SECONDS_8 = T.let(:"8", OpenAI::VideoSeconds::TaggedSymbol) + VIDEO_SECONDS_12 = T.let(:"12", OpenAI::VideoSeconds::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::VideoSeconds::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/openai/models/video_size.rbi b/rbi/openai/models/video_size.rbi new file mode 100644 index 00000000..111d0412 --- /dev/null +++ b/rbi/openai/models/video_size.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module OpenAI + module Models + module VideoSize + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::VideoSize) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIDEO_SIZE_720X1280 = T.let(:"720x1280", OpenAI::VideoSize::TaggedSymbol) + VIDEO_SIZE_1280X720 = T.let(:"1280x720", OpenAI::VideoSize::TaggedSymbol) + VIDEO_SIZE_1024X1792 = + T.let(:"1024x1792", OpenAI::VideoSize::TaggedSymbol) + VIDEO_SIZE_1792X1024 = + T.let(:"1792x1024", OpenAI::VideoSize::TaggedSymbol) + + sig { override.returns(T::Array[OpenAI::VideoSize::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/openai/resources/beta.rbi b/rbi/openai/resources/beta.rbi index c53baf2b..59a80881 100644 --- a/rbi/openai/resources/beta.rbi +++ b/rbi/openai/resources/beta.rbi @@ -3,6 +3,9 @@ module OpenAI module Resources class Beta + sig { returns(OpenAI::Resources::Beta::ChatKit) } + attr_reader :chatkit + sig { returns(OpenAI::Resources::Beta::Assistants) } attr_reader :assistants diff --git a/rbi/openai/resources/beta/chatkit.rbi b/rbi/openai/resources/beta/chatkit.rbi new file mode 100644 index 00000000..6232df45 --- /dev/null +++ b/rbi/openai/resources/beta/chatkit.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module OpenAI + module Resources + class Beta + class ChatKit + sig { returns(OpenAI::Resources::Beta::ChatKit::Sessions) } + attr_reader :sessions + + sig { returns(OpenAI::Resources::Beta::ChatKit::Threads) } + attr_reader :threads + + # Upload a ChatKit file + sig do + params( + file: OpenAI::Internal::FileInput, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Models::Beta::ChatKitUploadFileResponse::Variants) + end + def upload_file( + # Binary file contents to store with the ChatKit session. Supports PDFs and PNG, + # JPG, JPEG, GIF, or WEBP images. + file:, + request_options: {} + ) + end + + # @api private + sig { params(client: OpenAI::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/openai/resources/beta/chatkit/sessions.rbi b/rbi/openai/resources/beta/chatkit/sessions.rbi new file mode 100644 index 00000000..45e2877d --- /dev/null +++ b/rbi/openai/resources/beta/chatkit/sessions.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module OpenAI + module Resources + class Beta + class ChatKit + class Sessions + # Create a ChatKit session + sig do + params( + user: String, + workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::OrHash, + chatkit_configuration: + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::OrHash, + expires_after: + OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam::OrHash, + rate_limits: + OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam::OrHash, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Beta::ChatKit::ChatSession) + end + def create( + # A free-form string that identifies your end user; ensures this Session can + # access other objects that have the same `user` scope. + user:, + # Workflow that powers the session. + workflow:, + # Optional overrides for ChatKit runtime configuration features + chatkit_configuration: nil, + # Optional override for session expiration timing in seconds from creation. + # Defaults to 10 minutes. + expires_after: nil, + # Optional override for per-minute request limits. When omitted, defaults to 10. + rate_limits: nil, + request_options: {} + ) + end + + # Cancel a ChatKit session + sig do + params( + session_id: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Beta::ChatKit::ChatSession) + end + def cancel( + # Unique identifier for the ChatKit session to cancel. + session_id, + request_options: {} + ) + end + + # @api private + sig { params(client: OpenAI::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/openai/resources/beta/chatkit/threads.rbi b/rbi/openai/resources/beta/chatkit/threads.rbi new file mode 100644 index 00000000..90295b51 --- /dev/null +++ b/rbi/openai/resources/beta/chatkit/threads.rbi @@ -0,0 +1,110 @@ +# typed: strong + +module OpenAI + module Resources + class Beta + class ChatKit + class Threads + # Retrieve a ChatKit thread + sig do + params( + thread_id: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Beta::ChatKit::ChatKitThread) + end + def retrieve( + # Identifier of the ChatKit thread to retrieve. + thread_id, + request_options: {} + ) + end + + # List ChatKit threads + sig do + params( + after: String, + before: String, + limit: Integer, + order: OpenAI::Beta::ChatKit::ThreadListParams::Order::OrSymbol, + user: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns( + OpenAI::Internal::ConversationCursorPage[ + OpenAI::Beta::ChatKit::ChatKitThread + ] + ) + end + def list( + # List items created after this thread item ID. Defaults to null for the first + # page. + after: nil, + # List items created before this thread item ID. Defaults to null for the newest + # results. + before: nil, + # Maximum number of thread items to return. Defaults to 20. + limit: nil, + # Sort order for results by creation time. Defaults to `desc`. + order: nil, + # Filter threads that belong to this user identifier. Defaults to null to return + # all users. + user: nil, + request_options: {} + ) + end + + # Delete a ChatKit thread + sig do + params( + thread_id: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Models::Beta::ChatKit::ThreadDeleteResponse) + end + def delete( + # Identifier of the ChatKit thread to delete. + thread_id, + request_options: {} + ) + end + + # List ChatKit thread items + sig do + params( + thread_id: String, + after: String, + before: String, + limit: Integer, + order: + OpenAI::Beta::ChatKit::ThreadListItemsParams::Order::OrSymbol, + request_options: OpenAI::RequestOptions::OrHash + ).returns( + OpenAI::Internal::ConversationCursorPage[ + OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::Variants + ] + ) + end + def list_items( + # Identifier of the ChatKit thread whose items are requested. + thread_id, + # List items created after this thread item ID. Defaults to null for the first + # page. + after: nil, + # List items created before this thread item ID. Defaults to null for the newest + # results. + before: nil, + # Maximum number of thread items to return. Defaults to 20. + limit: nil, + # Sort order for results by creation time. Defaults to `desc`. + order: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: OpenAI::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/openai/resources/images.rbi b/rbi/openai/resources/images.rbi index b27c7c15..a2533c0d 100644 --- a/rbi/openai/resources/images.rbi +++ b/rbi/openai/resources/images.rbi @@ -91,7 +91,8 @@ module OpenAI background: nil, # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. input_fidelity: nil, # An additional image whose fully transparent areas (e.g. where alpha is zero) # indicate where `image` should be edited. If there are multiple images provided, @@ -194,7 +195,8 @@ module OpenAI background: nil, # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported - # for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. + # for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + # `low`. Defaults to `low`. input_fidelity: nil, # An additional image whose fully transparent areas (e.g. where alpha is zero) # indicate where `image` should be edited. If there are multiple images provided, diff --git a/rbi/openai/resources/videos.rbi b/rbi/openai/resources/videos.rbi new file mode 100644 index 00000000..ecc2ea6a --- /dev/null +++ b/rbi/openai/resources/videos.rbi @@ -0,0 +1,121 @@ +# typed: strong + +module OpenAI + module Resources + class Videos + # Create a video + sig do + params( + prompt: String, + input_reference: OpenAI::Internal::FileInput, + model: OpenAI::VideoModel::OrSymbol, + seconds: OpenAI::VideoSeconds::OrSymbol, + size: OpenAI::VideoSize::OrSymbol, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Video) + end + def create( + # Text prompt that describes the video to generate. + prompt:, + # Optional image reference that guides generation. + input_reference: nil, + # The video generation model to use. Defaults to `sora-2`. + model: nil, + # Clip duration in seconds. Defaults to 4 seconds. + seconds: nil, + # Output resolution formatted as width x height. Defaults to 720x1280. + size: nil, + request_options: {} + ) + end + + # Retrieve a video + sig do + params( + video_id: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Video) + end + def retrieve( + # The identifier of the video to retrieve. + video_id, + request_options: {} + ) + end + + # List videos + sig do + params( + after: String, + limit: Integer, + order: OpenAI::VideoListParams::Order::OrSymbol, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Internal::ConversationCursorPage[OpenAI::Video]) + end + def list( + # Identifier for the last item from the previous pagination request + after: nil, + # Number of items to retrieve + limit: nil, + # Sort order of results by timestamp. Use `asc` for ascending order or `desc` for + # descending order. + order: nil, + request_options: {} + ) + end + + # Delete a video + sig do + params( + video_id: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Models::VideoDeleteResponse) + end + def delete( + # The identifier of the video to delete. + video_id, + request_options: {} + ) + end + + # Download video content + sig do + params( + video_id: String, + variant: OpenAI::VideoDownloadContentParams::Variant::OrSymbol, + request_options: OpenAI::RequestOptions::OrHash + ).returns(StringIO) + end + def download_content( + # The identifier of the video whose media to download. + video_id, + # Which downloadable asset to return. Defaults to the MP4 video. + variant: nil, + request_options: {} + ) + end + + # Create a video remix + sig do + params( + video_id: String, + prompt: String, + request_options: OpenAI::RequestOptions::OrHash + ).returns(OpenAI::Video) + end + def remix( + # The identifier of the completed video to remix. + video_id, + # Updated text prompt that directs the remix generation. + prompt:, + request_options: {} + ) + end + + # @api private + sig { params(client: OpenAI::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 112f4354..48a35911 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -36,6 +36,9 @@ TEST_PATHS=( test/openai/resources/vector_stores/file_batches_test.rb test/openai/resources/webhooks_test.rb test/openai/resources/beta_test.rb + test/openai/resources/beta/chatkit_test.rb + test/openai/resources/beta/chatkit/sessions_test.rb + test/openai/resources/beta/chatkit/threads_test.rb test/openai/resources/beta/assistants_test.rb test/openai/resources/beta/threads_test.rb test/openai/resources/beta/threads/runs_test.rb @@ -57,6 +60,7 @@ TEST_PATHS=( test/openai/resources/containers_test.rb test/openai/resources/containers/files_test.rb test/openai/resources/containers/files/content_test.rb + test/openai/resources/videos_test.rb test/openai/client_test.rb ) diff --git a/sig/openai/client.rbs b/sig/openai/client.rbs index aef1394c..0f250719 100644 --- a/sig/openai/client.rbs +++ b/sig/openai/client.rbs @@ -54,6 +54,8 @@ module OpenAI attr_reader containers: OpenAI::Resources::Containers + attr_reader videos: OpenAI::Resources::Videos + private def auth_headers: -> ::Hash[String, String] def initialize: ( diff --git a/sig/openai/models.rbs b/sig/openai/models.rbs index 022e367f..858f095e 100644 --- a/sig/openai/models.rbs +++ b/sig/openai/models.rbs @@ -217,5 +217,27 @@ module OpenAI class VectorStoreUpdateParams = OpenAI::Models::VectorStoreUpdateParams + class Video = OpenAI::Models::Video + + class VideoCreateError = OpenAI::Models::VideoCreateError + + class VideoCreateParams = OpenAI::Models::VideoCreateParams + + class VideoDeleteParams = OpenAI::Models::VideoDeleteParams + + class VideoDownloadContentParams = OpenAI::Models::VideoDownloadContentParams + + class VideoListParams = OpenAI::Models::VideoListParams + + module VideoModel = OpenAI::Models::VideoModel + + class VideoRemixParams = OpenAI::Models::VideoRemixParams + + class VideoRetrieveParams = OpenAI::Models::VideoRetrieveParams + + module VideoSeconds = OpenAI::Models::VideoSeconds + + module VideoSize = OpenAI::Models::VideoSize + module Webhooks = OpenAI::Models::Webhooks end diff --git a/sig/openai/models/all_models.rbs b/sig/openai/models/all_models.rbs index 53864a35..d1cd7893 100644 --- a/sig/openai/models/all_models.rbs +++ b/sig/openai/models/all_models.rbs @@ -20,6 +20,8 @@ module OpenAI | :"computer-use-preview" | :"computer-use-preview-2025-03-11" | :"gpt-5-codex" + | :"gpt-5-pro" + | :"gpt-5-pro-2025-10-06" module ResponsesOnlyModel extend OpenAI::Internal::Type::Enum @@ -35,6 +37,8 @@ module OpenAI COMPUTER_USE_PREVIEW: :"computer-use-preview" COMPUTER_USE_PREVIEW_2025_03_11: :"computer-use-preview-2025-03-11" GPT_5_CODEX: :"gpt-5-codex" + GPT_5_PRO: :"gpt-5-pro" + GPT_5_PRO_2025_10_06: :"gpt-5-pro-2025-10-06" def self?.values: -> ::Array[OpenAI::Models::AllModels::responses_only_model] end diff --git a/sig/openai/models/beta/chatkit/chat_session.rbs b/sig/openai/models/beta/chatkit/chat_session.rbs new file mode 100644 index 00000000..c2d5144a --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session.rbs @@ -0,0 +1,69 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session = + { + id: String, + chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration, + client_secret: String, + expires_at: Integer, + :max_requests_per_1_minute => Integer, + object: :"chatkit.session", + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits, + status: OpenAI::Models::Beta::ChatKit::chat_session_status, + user: String, + workflow: OpenAI::Beta::ChatKitWorkflow + } + + class ChatSession < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration + + attr_accessor client_secret: String + + attr_accessor expires_at: Integer + + attr_accessor max_requests_per_1_minute: Integer + + attr_accessor object: :"chatkit.session" + + attr_accessor rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits + + attr_accessor status: OpenAI::Models::Beta::ChatKit::chat_session_status + + attr_accessor user: String + + attr_accessor workflow: OpenAI::Beta::ChatKitWorkflow + + def initialize: ( + id: String, + chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration, + client_secret: String, + expires_at: Integer, + max_requests_per_1_minute: Integer, + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits, + status: OpenAI::Models::Beta::ChatKit::chat_session_status, + user: String, + workflow: OpenAI::Beta::ChatKitWorkflow, + ?object: :"chatkit.session" + ) -> void + + def to_hash: -> { + id: String, + chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration, + client_secret: String, + expires_at: Integer, + :max_requests_per_1_minute => Integer, + object: :"chatkit.session", + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits, + status: OpenAI::Models::Beta::ChatKit::chat_session_status, + user: String, + workflow: OpenAI::Beta::ChatKitWorkflow + } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbs b/sig/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbs new file mode 100644 index 00000000..583f15ed --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbs @@ -0,0 +1,17 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_automatic_thread_titling = { enabled: bool } + + class ChatSessionAutomaticThreadTitling < OpenAI::Internal::Type::BaseModel + attr_accessor enabled: bool + + def initialize: (enabled: bool) -> void + + def to_hash: -> { enabled: bool } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbs b/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbs new file mode 100644 index 00000000..059218bf --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbs @@ -0,0 +1,34 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_chatkit_configuration = + { + automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling, + file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload, + history: OpenAI::Beta::ChatKit::ChatSessionHistory + } + + class ChatSessionChatKitConfiguration < OpenAI::Internal::Type::BaseModel + attr_accessor automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling + + attr_accessor file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload + + attr_accessor history: OpenAI::Beta::ChatKit::ChatSessionHistory + + def initialize: ( + automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling, + file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload, + history: OpenAI::Beta::ChatKit::ChatSessionHistory + ) -> void + + def to_hash: -> { + automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling, + file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload, + history: OpenAI::Beta::ChatKit::ChatSessionHistory + } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbs b/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbs new file mode 100644 index 00000000..b04103db --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbs @@ -0,0 +1,103 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_chatkit_configuration_param = + { + automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling, + file_upload: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload, + history: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History + } + + class ChatSessionChatKitConfigurationParam < OpenAI::Internal::Type::BaseModel + attr_reader automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling? + + def automatic_thread_titling=: ( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling + ) -> OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling + + attr_reader file_upload: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload? + + def file_upload=: ( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload + ) -> OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload + + attr_reader history: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History? + + def history=: ( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History + ) -> OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History + + def initialize: ( + ?automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling, + ?file_upload: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload, + ?history: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History + ) -> void + + def to_hash: -> { + automatic_thread_titling: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling, + file_upload: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload, + history: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History + } + + type automatic_thread_titling = { enabled: bool } + + class AutomaticThreadTitling < OpenAI::Internal::Type::BaseModel + attr_reader enabled: bool? + + def enabled=: (bool) -> bool + + def initialize: (?enabled: bool) -> void + + def to_hash: -> { enabled: bool } + end + + type file_upload = + { enabled: bool, max_file_size: Integer, max_files: Integer } + + class FileUpload < OpenAI::Internal::Type::BaseModel + attr_reader enabled: bool? + + def enabled=: (bool) -> bool + + attr_reader max_file_size: Integer? + + def max_file_size=: (Integer) -> Integer + + attr_reader max_files: Integer? + + def max_files=: (Integer) -> Integer + + def initialize: ( + ?enabled: bool, + ?max_file_size: Integer, + ?max_files: Integer + ) -> void + + def to_hash: -> { + enabled: bool, + max_file_size: Integer, + max_files: Integer + } + end + + type history = { enabled: bool, recent_threads: Integer } + + class History < OpenAI::Internal::Type::BaseModel + attr_reader enabled: bool? + + def enabled=: (bool) -> bool + + attr_reader recent_threads: Integer? + + def recent_threads=: (Integer) -> Integer + + def initialize: (?enabled: bool, ?recent_threads: Integer) -> void + + def to_hash: -> { enabled: bool, recent_threads: Integer } + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_expires_after_param.rbs b/sig/openai/models/beta/chatkit/chat_session_expires_after_param.rbs new file mode 100644 index 00000000..f1f7ad6c --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_expires_after_param.rbs @@ -0,0 +1,20 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_expires_after_param = + { anchor: :created_at, seconds: Integer } + + class ChatSessionExpiresAfterParam < OpenAI::Internal::Type::BaseModel + attr_accessor anchor: :created_at + + attr_accessor seconds: Integer + + def initialize: (seconds: Integer, ?anchor: :created_at) -> void + + def to_hash: -> { anchor: :created_at, seconds: Integer } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_file_upload.rbs b/sig/openai/models/beta/chatkit/chat_session_file_upload.rbs new file mode 100644 index 00000000..8a8569a0 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_file_upload.rbs @@ -0,0 +1,30 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_file_upload = + { enabled: bool, max_file_size: Integer?, max_files: Integer? } + + class ChatSessionFileUpload < OpenAI::Internal::Type::BaseModel + attr_accessor enabled: bool + + attr_accessor max_file_size: Integer? + + attr_accessor max_files: Integer? + + def initialize: ( + enabled: bool, + max_file_size: Integer?, + max_files: Integer? + ) -> void + + def to_hash: -> { + enabled: bool, + max_file_size: Integer?, + max_files: Integer? + } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_history.rbs b/sig/openai/models/beta/chatkit/chat_session_history.rbs new file mode 100644 index 00000000..7c398b09 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_history.rbs @@ -0,0 +1,19 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_history = { enabled: bool, recent_threads: Integer? } + + class ChatSessionHistory < OpenAI::Internal::Type::BaseModel + attr_accessor enabled: bool + + attr_accessor recent_threads: Integer? + + def initialize: (enabled: bool, recent_threads: Integer?) -> void + + def to_hash: -> { enabled: bool, recent_threads: Integer? } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_rate_limits.rbs b/sig/openai/models/beta/chatkit/chat_session_rate_limits.rbs new file mode 100644 index 00000000..cddce871 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_rate_limits.rbs @@ -0,0 +1,18 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_rate_limits = + { :max_requests_per_1_minute => Integer } + + class ChatSessionRateLimits < OpenAI::Internal::Type::BaseModel + attr_accessor max_requests_per_1_minute: Integer + + def initialize: (max_requests_per_1_minute: Integer) -> void + + def to_hash: -> { :max_requests_per_1_minute => Integer } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_rate_limits_param.rbs b/sig/openai/models/beta/chatkit/chat_session_rate_limits_param.rbs new file mode 100644 index 00000000..3655e496 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_rate_limits_param.rbs @@ -0,0 +1,20 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_rate_limits_param = + { :max_requests_per_1_minute => Integer } + + class ChatSessionRateLimitsParam < OpenAI::Internal::Type::BaseModel + attr_reader max_requests_per_1_minute: Integer? + + def max_requests_per_1_minute=: (Integer) -> Integer + + def initialize: (?max_requests_per_1_minute: Integer) -> void + + def to_hash: -> { :max_requests_per_1_minute => Integer } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_status.rbs b/sig/openai/models/beta/chatkit/chat_session_status.rbs new file mode 100644 index 00000000..344e18c9 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_status.rbs @@ -0,0 +1,19 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_status = :active | :expired | :cancelled + + module ChatSessionStatus + extend OpenAI::Internal::Type::Enum + + ACTIVE: :active + EXPIRED: :expired + CANCELLED: :cancelled + + def self?.values: -> ::Array[OpenAI::Models::Beta::ChatKit::chat_session_status] + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chat_session_workflow_param.rbs b/sig/openai/models/beta/chatkit/chat_session_workflow_param.rbs new file mode 100644 index 00000000..15311655 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chat_session_workflow_param.rbs @@ -0,0 +1,69 @@ +module OpenAI + module Models + module Beta + module ChatKit + type chat_session_workflow_param = + { + id: String, + state_variables: ::Hash[Symbol, OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::state_variable], + tracing: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing, + version: String + } + + class ChatSessionWorkflowParam < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_reader state_variables: ::Hash[Symbol, OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::state_variable]? + + def state_variables=: ( + ::Hash[Symbol, OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::state_variable] + ) -> ::Hash[Symbol, OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::state_variable] + + attr_reader tracing: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing? + + def tracing=: ( + OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing + ) -> OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing + + attr_reader version: String? + + def version=: (String) -> String + + def initialize: ( + id: String, + ?state_variables: ::Hash[Symbol, OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::state_variable], + ?tracing: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing, + ?version: String + ) -> void + + def to_hash: -> { + id: String, + state_variables: ::Hash[Symbol, OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::state_variable], + tracing: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam::Tracing, + version: String + } + + type state_variable = String | bool | Float + + module StateVariable + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatSessionWorkflowParam::state_variable] + end + + type tracing = { enabled: bool } + + class Tracing < OpenAI::Internal::Type::BaseModel + attr_reader enabled: bool? + + def enabled=: (bool) -> bool + + def initialize: (?enabled: bool) -> void + + def to_hash: -> { enabled: bool } + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chatkit_attachment.rbs b/sig/openai/models/beta/chatkit/chatkit_attachment.rbs new file mode 100644 index 00000000..2ce83b7e --- /dev/null +++ b/sig/openai/models/beta/chatkit/chatkit_attachment.rbs @@ -0,0 +1,57 @@ +module OpenAI + module Models + module Beta + class ChatKitAttachment = ChatKit::ChatKitAttachment + + module ChatKit + type chatkit_attachment = + { + id: String, + mime_type: String, + name: String, + preview_url: String?, + type: OpenAI::Models::Beta::ChatKit::ChatKitAttachment::type_ + } + + class ChatKitAttachment < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor mime_type: String + + attr_accessor name: String + + attr_accessor preview_url: String? + + attr_accessor type: OpenAI::Models::Beta::ChatKit::ChatKitAttachment::type_ + + def initialize: ( + id: String, + mime_type: String, + name: String, + preview_url: String?, + type: OpenAI::Models::Beta::ChatKit::ChatKitAttachment::type_ + ) -> void + + def to_hash: -> { + id: String, + mime_type: String, + name: String, + preview_url: String?, + type: OpenAI::Models::Beta::ChatKit::ChatKitAttachment::type_ + } + + type type_ = :image | :file + + module Type + extend OpenAI::Internal::Type::Enum + + IMAGE: :image + FILE: :file + + def self?.values: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatKitAttachment::type_] + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chatkit_response_output_text.rbs b/sig/openai/models/beta/chatkit/chatkit_response_output_text.rbs new file mode 100644 index 00000000..d43b4eb9 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chatkit_response_output_text.rbs @@ -0,0 +1,114 @@ +module OpenAI + module Models + module Beta + class ChatKitResponseOutputText = ChatKit::ChatKitResponseOutputText + + module ChatKit + type chatkit_response_output_text = + { + annotations: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::annotation], + text: String, + type: :output_text + } + + class ChatKitResponseOutputText < OpenAI::Internal::Type::BaseModel + attr_accessor annotations: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::annotation] + + attr_accessor text: String + + attr_accessor type: :output_text + + def initialize: ( + annotations: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::annotation], + text: String, + ?type: :output_text + ) -> void + + def to_hash: -> { + annotations: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::annotation], + text: String, + type: :output_text + } + + type annotation = + OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File + | OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL + + module Annotation + extend OpenAI::Internal::Type::Union + + type file = + { + source: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source, + type: :file + } + + class File < OpenAI::Internal::Type::BaseModel + attr_accessor source: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source + + attr_accessor type: :file + + def initialize: ( + source: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source, + ?type: :file + ) -> void + + def to_hash: -> { + source: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source, + type: :file + } + + type source = { filename: String, type: :file } + + class Source < OpenAI::Internal::Type::BaseModel + attr_accessor filename: String + + attr_accessor type: :file + + def initialize: (filename: String, ?type: :file) -> void + + def to_hash: -> { filename: String, type: :file } + end + end + + type url = + { + source: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source, + type: :url + } + + class URL < OpenAI::Internal::Type::BaseModel + attr_accessor source: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source + + attr_accessor type: :url + + def initialize: ( + source: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source, + ?type: :url + ) -> void + + def to_hash: -> { + source: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source, + type: :url + } + + type source = { type: :url, url: String } + + class Source < OpenAI::Internal::Type::BaseModel + attr_accessor type: :url + + attr_accessor url: String + + def initialize: (url: String, ?type: :url) -> void + + def to_hash: -> { type: :url, url: String } + end + end + + def self?.variants: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::annotation] + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chatkit_thread.rbs b/sig/openai/models/beta/chatkit/chatkit_thread.rbs new file mode 100644 index 00000000..f54ba003 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chatkit_thread.rbs @@ -0,0 +1,96 @@ +module OpenAI + module Models + module Beta + class ChatKitThread = ChatKit::ChatKitThread + + module ChatKit + type chatkit_thread = + { + id: String, + created_at: Integer, + object: :"chatkit.thread", + status: OpenAI::Models::Beta::ChatKit::ChatKitThread::status, + title: String?, + user: String + } + + class ChatKitThread < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Integer + + attr_accessor object: :"chatkit.thread" + + attr_accessor status: OpenAI::Models::Beta::ChatKit::ChatKitThread::status + + attr_accessor title: String? + + attr_accessor user: String + + def initialize: ( + id: String, + created_at: Integer, + status: OpenAI::Models::Beta::ChatKit::ChatKitThread::status, + title: String?, + user: String, + ?object: :"chatkit.thread" + ) -> void + + def to_hash: -> { + id: String, + created_at: Integer, + object: :"chatkit.thread", + status: OpenAI::Models::Beta::ChatKit::ChatKitThread::status, + title: String?, + user: String + } + + type status = + OpenAI::Beta::ChatKit::ChatKitThread::Status::Active + | OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked + | OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed + + module Status + extend OpenAI::Internal::Type::Union + + type active = { type: :active } + + class Active < OpenAI::Internal::Type::BaseModel + attr_accessor type: :active + + def initialize: (?type: :active) -> void + + def to_hash: -> { type: :active } + end + + type locked = { reason: String?, type: :locked } + + class Locked < OpenAI::Internal::Type::BaseModel + attr_accessor reason: String? + + attr_accessor type: :locked + + def initialize: (reason: String?, ?type: :locked) -> void + + def to_hash: -> { reason: String?, type: :locked } + end + + type closed = { reason: String?, type: :closed } + + class Closed < OpenAI::Internal::Type::BaseModel + attr_accessor reason: String? + + attr_accessor type: :closed + + def initialize: (reason: String?, ?type: :closed) -> void + + def to_hash: -> { reason: String?, type: :closed } + end + + def self?.variants: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThread::status] + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbs b/sig/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbs new file mode 100644 index 00000000..a740c42d --- /dev/null +++ b/sig/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbs @@ -0,0 +1,51 @@ +module OpenAI + module Models + module Beta + class ChatKitThreadAssistantMessageItem = ChatKit::ChatKitThreadAssistantMessageItem + + module ChatKit + type chatkit_thread_assistant_message_item = + { + id: String, + content: ::Array[OpenAI::Beta::ChatKit::ChatKitResponseOutputText], + created_at: Integer, + object: :"chatkit.thread_item", + thread_id: String, + type: :"chatkit.assistant_message" + } + + class ChatKitThreadAssistantMessageItem < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor content: ::Array[OpenAI::Beta::ChatKit::ChatKitResponseOutputText] + + attr_accessor created_at: Integer + + attr_accessor object: :"chatkit.thread_item" + + attr_accessor thread_id: String + + attr_accessor type: :"chatkit.assistant_message" + + def initialize: ( + id: String, + content: ::Array[OpenAI::Beta::ChatKit::ChatKitResponseOutputText], + created_at: Integer, + thread_id: String, + ?object: :"chatkit.thread_item", + ?type: :"chatkit.assistant_message" + ) -> void + + def to_hash: -> { + id: String, + content: ::Array[OpenAI::Beta::ChatKit::ChatKitResponseOutputText], + created_at: Integer, + object: :"chatkit.thread_item", + thread_id: String, + type: :"chatkit.assistant_message" + } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chatkit_thread_item_list.rbs b/sig/openai/models/beta/chatkit/chatkit_thread_item_list.rbs new file mode 100644 index 00000000..2b229752 --- /dev/null +++ b/sig/openai/models/beta/chatkit/chatkit_thread_item_list.rbs @@ -0,0 +1,276 @@ +module OpenAI + module Models + module Beta + class ChatKitThreadItemList = ChatKit::ChatKitThreadItemList + + module ChatKit + type chatkit_thread_item_list = + { + data: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::data], + first_id: String?, + has_more: bool, + last_id: String?, + object: :list + } + + class ChatKitThreadItemList < OpenAI::Internal::Type::BaseModel + attr_accessor data: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::data] + + attr_accessor first_id: String? + + attr_accessor has_more: bool + + attr_accessor last_id: String? + + attr_accessor object: :list + + def initialize: ( + data: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::data], + first_id: String?, + has_more: bool, + last_id: String?, + ?object: :list + ) -> void + + def to_hash: -> { + data: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::data], + first_id: String?, + has_more: bool, + last_id: String?, + object: :list + } + + type data = + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem + | OpenAI::Beta::ChatKit::ChatKitThreadAssistantMessageItem + | OpenAI::Beta::ChatKit::ChatKitWidgetItem + | OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall + | OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask + | OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup + + module Data + extend OpenAI::Internal::Type::Union + + type chatkit_client_tool_call = + { + id: String, + arguments: String, + call_id: String, + created_at: Integer, + name: String, + object: :"chatkit.thread_item", + output: String?, + status: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::status, + thread_id: String, + type: :"chatkit.client_tool_call" + } + + class ChatKitClientToolCall < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor arguments: String + + attr_accessor call_id: String + + attr_accessor created_at: Integer + + attr_accessor name: String + + attr_accessor object: :"chatkit.thread_item" + + attr_accessor output: String? + + attr_accessor status: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::status + + attr_accessor thread_id: String + + attr_accessor type: :"chatkit.client_tool_call" + + def initialize: ( + id: String, + arguments: String, + call_id: String, + created_at: Integer, + name: String, + output: String?, + status: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::status, + thread_id: String, + ?object: :"chatkit.thread_item", + ?type: :"chatkit.client_tool_call" + ) -> void + + def to_hash: -> { + id: String, + arguments: String, + call_id: String, + created_at: Integer, + name: String, + object: :"chatkit.thread_item", + output: String?, + status: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::status, + thread_id: String, + type: :"chatkit.client_tool_call" + } + + type status = :in_progress | :completed + + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS: :in_progress + COMPLETED: :completed + + def self?.values: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::status] + end + end + + type chatkit_task = + { + id: String, + created_at: Integer, + heading: String?, + object: :"chatkit.thread_item", + summary: String?, + task_type: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::task_type, + thread_id: String, + type: :"chatkit.task" + } + + class ChatKitTask < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Integer + + attr_accessor heading: String? + + attr_accessor object: :"chatkit.thread_item" + + attr_accessor summary: String? + + attr_accessor task_type: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::task_type + + attr_accessor thread_id: String + + attr_accessor type: :"chatkit.task" + + def initialize: ( + id: String, + created_at: Integer, + heading: String?, + summary: String?, + task_type: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::task_type, + thread_id: String, + ?object: :"chatkit.thread_item", + ?type: :"chatkit.task" + ) -> void + + def to_hash: -> { + id: String, + created_at: Integer, + heading: String?, + object: :"chatkit.thread_item", + summary: String?, + task_type: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::task_type, + thread_id: String, + type: :"chatkit.task" + } + + type task_type = :custom | :thought + + module TaskType + extend OpenAI::Internal::Type::Enum + + CUSTOM: :custom + THOUGHT: :thought + + def self?.values: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::task_type] + end + end + + type chatkit_task_group = + { + id: String, + created_at: Integer, + object: :"chatkit.thread_item", + tasks: ::Array[OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task], + thread_id: String, + type: :"chatkit.task_group" + } + + class ChatKitTaskGroup < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Integer + + attr_accessor object: :"chatkit.thread_item" + + attr_accessor tasks: ::Array[OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task] + + attr_accessor thread_id: String + + attr_accessor type: :"chatkit.task_group" + + def initialize: ( + id: String, + created_at: Integer, + tasks: ::Array[OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task], + thread_id: String, + ?object: :"chatkit.thread_item", + ?type: :"chatkit.task_group" + ) -> void + + def to_hash: -> { + id: String, + created_at: Integer, + object: :"chatkit.thread_item", + tasks: ::Array[OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task], + thread_id: String, + type: :"chatkit.task_group" + } + + type task = + { + heading: String?, + summary: String?, + type: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::type_ + } + + class Task < OpenAI::Internal::Type::BaseModel + attr_accessor heading: String? + + attr_accessor summary: String? + + attr_accessor type: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::type_ + + def initialize: ( + heading: String?, + summary: String?, + type: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::type_ + ) -> void + + def to_hash: -> { + heading: String?, + summary: String?, + type: OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::type_ + } + + type type_ = :custom | :thought + + module Type + extend OpenAI::Internal::Type::Enum + + CUSTOM: :custom + THOUGHT: :thought + + def self?.values: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task::type_] + end + end + end + + def self?.variants: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::data] + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbs b/sig/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbs new file mode 100644 index 00000000..c537c6cb --- /dev/null +++ b/sig/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbs @@ -0,0 +1,127 @@ +module OpenAI + module Models + module Beta + class ChatKitThreadUserMessageItem = ChatKit::ChatKitThreadUserMessageItem + + module ChatKit + type chatkit_thread_user_message_item = + { + id: String, + attachments: ::Array[OpenAI::Beta::ChatKit::ChatKitAttachment], + content: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::content], + created_at: Integer, + inference_options: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions?, + object: :"chatkit.thread_item", + thread_id: String, + type: :"chatkit.user_message" + } + + class ChatKitThreadUserMessageItem < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor attachments: ::Array[OpenAI::Beta::ChatKit::ChatKitAttachment] + + attr_accessor content: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::content] + + attr_accessor created_at: Integer + + attr_accessor inference_options: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions? + + attr_accessor object: :"chatkit.thread_item" + + attr_accessor thread_id: String + + attr_accessor type: :"chatkit.user_message" + + def initialize: ( + id: String, + attachments: ::Array[OpenAI::Beta::ChatKit::ChatKitAttachment], + content: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::content], + created_at: Integer, + inference_options: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions?, + thread_id: String, + ?object: :"chatkit.thread_item", + ?type: :"chatkit.user_message" + ) -> void + + def to_hash: -> { + id: String, + attachments: ::Array[OpenAI::Beta::ChatKit::ChatKitAttachment], + content: ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::content], + created_at: Integer, + inference_options: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions?, + object: :"chatkit.thread_item", + thread_id: String, + type: :"chatkit.user_message" + } + + type content = + OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::InputText + | OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content::QuotedText + + module Content + extend OpenAI::Internal::Type::Union + + type input_text = { text: String, type: :input_text } + + class InputText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :input_text + + def initialize: (text: String, ?type: :input_text) -> void + + def to_hash: -> { text: String, type: :input_text } + end + + type quoted_text = { text: String, type: :quoted_text } + + class QuotedText < OpenAI::Internal::Type::BaseModel + attr_accessor text: String + + attr_accessor type: :quoted_text + + def initialize: (text: String, ?type: :quoted_text) -> void + + def to_hash: -> { text: String, type: :quoted_text } + end + + def self?.variants: -> ::Array[OpenAI::Models::Beta::ChatKit::ChatKitThreadUserMessageItem::content] + end + + type inference_options = + { + model: String?, + tool_choice: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice? + } + + class InferenceOptions < OpenAI::Internal::Type::BaseModel + attr_accessor model: String? + + attr_accessor tool_choice: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice? + + def initialize: ( + model: String?, + tool_choice: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice? + ) -> void + + def to_hash: -> { + model: String?, + tool_choice: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions::ToolChoice? + } + + type tool_choice = { id: String } + + class ToolChoice < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/chatkit_widget_item.rbs b/sig/openai/models/beta/chatkit/chatkit_widget_item.rbs new file mode 100644 index 00000000..f67e4b6a --- /dev/null +++ b/sig/openai/models/beta/chatkit/chatkit_widget_item.rbs @@ -0,0 +1,51 @@ +module OpenAI + module Models + module Beta + class ChatKitWidgetItem = ChatKit::ChatKitWidgetItem + + module ChatKit + type chatkit_widget_item = + { + id: String, + created_at: Integer, + object: :"chatkit.thread_item", + thread_id: String, + type: :"chatkit.widget", + widget: String + } + + class ChatKitWidgetItem < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Integer + + attr_accessor object: :"chatkit.thread_item" + + attr_accessor thread_id: String + + attr_accessor type: :"chatkit.widget" + + attr_accessor widget: String + + def initialize: ( + id: String, + created_at: Integer, + thread_id: String, + widget: String, + ?object: :"chatkit.thread_item", + ?type: :"chatkit.widget" + ) -> void + + def to_hash: -> { + id: String, + created_at: Integer, + object: :"chatkit.thread_item", + thread_id: String, + type: :"chatkit.widget", + widget: String + } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/session_cancel_params.rbs b/sig/openai/models/beta/chatkit/session_cancel_params.rbs new file mode 100644 index 00000000..c7def9f3 --- /dev/null +++ b/sig/openai/models/beta/chatkit/session_cancel_params.rbs @@ -0,0 +1,19 @@ +module OpenAI + module Models + module Beta + module ChatKit + type session_cancel_params = + { } & OpenAI::Internal::Type::request_parameters + + class SessionCancelParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + def initialize: (?request_options: OpenAI::request_opts) -> void + + def to_hash: -> { request_options: OpenAI::RequestOptions } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/session_create_params.rbs b/sig/openai/models/beta/chatkit/session_create_params.rbs new file mode 100644 index 00000000..b89bb8b7 --- /dev/null +++ b/sig/openai/models/beta/chatkit/session_create_params.rbs @@ -0,0 +1,62 @@ +module OpenAI + module Models + module Beta + module ChatKit + type session_create_params = + { + user: String, + workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam, + chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam, + expires_after: OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam, + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam + } + & OpenAI::Internal::Type::request_parameters + + class SessionCreateParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + attr_accessor user: String + + attr_accessor workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam + + attr_reader chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam? + + def chatkit_configuration=: ( + OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam + ) -> OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam + + attr_reader expires_after: OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam? + + def expires_after=: ( + OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam + ) -> OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam + + attr_reader rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam? + + def rate_limits=: ( + OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam + ) -> OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam + + def initialize: ( + user: String, + workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam, + ?chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam, + ?expires_after: OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam, + ?rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam, + ?request_options: OpenAI::request_opts + ) -> void + + def to_hash: -> { + user: String, + workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam, + chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam, + expires_after: OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam, + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam, + request_options: OpenAI::RequestOptions + } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/thread_delete_params.rbs b/sig/openai/models/beta/chatkit/thread_delete_params.rbs new file mode 100644 index 00000000..77173854 --- /dev/null +++ b/sig/openai/models/beta/chatkit/thread_delete_params.rbs @@ -0,0 +1,19 @@ +module OpenAI + module Models + module Beta + module ChatKit + type thread_delete_params = + { } & OpenAI::Internal::Type::request_parameters + + class ThreadDeleteParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + def initialize: (?request_options: OpenAI::request_opts) -> void + + def to_hash: -> { request_options: OpenAI::RequestOptions } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/thread_delete_response.rbs b/sig/openai/models/beta/chatkit/thread_delete_response.rbs new file mode 100644 index 00000000..3825eefd --- /dev/null +++ b/sig/openai/models/beta/chatkit/thread_delete_response.rbs @@ -0,0 +1,30 @@ +module OpenAI + module Models + module Beta + module ChatKit + type thread_delete_response = + { id: String, deleted: bool, object: :"chatkit.thread.deleted" } + + class ThreadDeleteResponse < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor deleted: bool + + attr_accessor object: :"chatkit.thread.deleted" + + def initialize: ( + id: String, + deleted: bool, + ?object: :"chatkit.thread.deleted" + ) -> void + + def to_hash: -> { + id: String, + deleted: bool, + object: :"chatkit.thread.deleted" + } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/thread_list_items_params.rbs b/sig/openai/models/beta/chatkit/thread_list_items_params.rbs new file mode 100644 index 00000000..abd1caa9 --- /dev/null +++ b/sig/openai/models/beta/chatkit/thread_list_items_params.rbs @@ -0,0 +1,66 @@ +module OpenAI + module Models + module Beta + module ChatKit + type thread_list_items_params = + { + after: String, + before: String, + limit: Integer, + order: OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::order + } + & OpenAI::Internal::Type::request_parameters + + class ThreadListItemsParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader order: OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::order? + + def order=: ( + OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::order + ) -> OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::order + + def initialize: ( + ?after: String, + ?before: String, + ?limit: Integer, + ?order: OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::order, + ?request_options: OpenAI::request_opts + ) -> void + + def to_hash: -> { + after: String, + before: String, + limit: Integer, + order: OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::order, + request_options: OpenAI::RequestOptions + } + + type order = :asc | :desc + + module Order + extend OpenAI::Internal::Type::Enum + + ASC: :asc + DESC: :desc + + def self?.values: -> ::Array[OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::order] + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/thread_list_params.rbs b/sig/openai/models/beta/chatkit/thread_list_params.rbs new file mode 100644 index 00000000..a5a39480 --- /dev/null +++ b/sig/openai/models/beta/chatkit/thread_list_params.rbs @@ -0,0 +1,73 @@ +module OpenAI + module Models + module Beta + module ChatKit + type thread_list_params = + { + after: String, + before: String, + limit: Integer, + order: OpenAI::Models::Beta::ChatKit::ThreadListParams::order, + user: String + } + & OpenAI::Internal::Type::request_parameters + + class ThreadListParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader order: OpenAI::Models::Beta::ChatKit::ThreadListParams::order? + + def order=: ( + OpenAI::Models::Beta::ChatKit::ThreadListParams::order + ) -> OpenAI::Models::Beta::ChatKit::ThreadListParams::order + + attr_reader user: String? + + def user=: (String) -> String + + def initialize: ( + ?after: String, + ?before: String, + ?limit: Integer, + ?order: OpenAI::Models::Beta::ChatKit::ThreadListParams::order, + ?user: String, + ?request_options: OpenAI::request_opts + ) -> void + + def to_hash: -> { + after: String, + before: String, + limit: Integer, + order: OpenAI::Models::Beta::ChatKit::ThreadListParams::order, + user: String, + request_options: OpenAI::RequestOptions + } + + type order = :asc | :desc + + module Order + extend OpenAI::Internal::Type::Enum + + ASC: :asc + DESC: :desc + + def self?.values: -> ::Array[OpenAI::Models::Beta::ChatKit::ThreadListParams::order] + end + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit/thread_retrieve_params.rbs b/sig/openai/models/beta/chatkit/thread_retrieve_params.rbs new file mode 100644 index 00000000..8a9b5c4e --- /dev/null +++ b/sig/openai/models/beta/chatkit/thread_retrieve_params.rbs @@ -0,0 +1,19 @@ +module OpenAI + module Models + module Beta + module ChatKit + type thread_retrieve_params = + { } & OpenAI::Internal::Type::request_parameters + + class ThreadRetrieveParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + def initialize: (?request_options: OpenAI::request_opts) -> void + + def to_hash: -> { request_options: OpenAI::RequestOptions } + end + end + end + end +end diff --git a/sig/openai/models/beta/chatkit_upload_file_params.rbs b/sig/openai/models/beta/chatkit_upload_file_params.rbs new file mode 100644 index 00000000..82f490dd --- /dev/null +++ b/sig/openai/models/beta/chatkit_upload_file_params.rbs @@ -0,0 +1,26 @@ +module OpenAI + module Models + module Beta + type chatkit_upload_file_params = + { file: OpenAI::Internal::file_input } + & OpenAI::Internal::Type::request_parameters + + class ChatKitUploadFileParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + attr_accessor file: OpenAI::Internal::file_input + + def initialize: ( + file: OpenAI::Internal::file_input, + ?request_options: OpenAI::request_opts + ) -> void + + def to_hash: -> { + file: OpenAI::Internal::file_input, + request_options: OpenAI::RequestOptions + } + end + end + end +end diff --git a/sig/openai/models/beta/chatkit_upload_file_response.rbs b/sig/openai/models/beta/chatkit_upload_file_response.rbs new file mode 100644 index 00000000..ebd42d98 --- /dev/null +++ b/sig/openai/models/beta/chatkit_upload_file_response.rbs @@ -0,0 +1,14 @@ +module OpenAI + module Models + module Beta + type chatkit_upload_file_response = + OpenAI::Beta::FilePart | OpenAI::Beta::ImagePart + + module ChatKitUploadFileResponse + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Beta::chatkit_upload_file_response] + end + end + end +end diff --git a/sig/openai/models/beta/chatkit_workflow.rbs b/sig/openai/models/beta/chatkit_workflow.rbs new file mode 100644 index 00000000..509f6604 --- /dev/null +++ b/sig/openai/models/beta/chatkit_workflow.rbs @@ -0,0 +1,55 @@ +module OpenAI + module Models + module Beta + type chatkit_workflow = + { + id: String, + state_variables: ::Hash[Symbol, OpenAI::Models::Beta::ChatKitWorkflow::state_variable]?, + tracing: OpenAI::Beta::ChatKitWorkflow::Tracing, + version: String? + } + + class ChatKitWorkflow < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor state_variables: ::Hash[Symbol, OpenAI::Models::Beta::ChatKitWorkflow::state_variable]? + + attr_accessor tracing: OpenAI::Beta::ChatKitWorkflow::Tracing + + attr_accessor version: String? + + def initialize: ( + id: String, + state_variables: ::Hash[Symbol, OpenAI::Models::Beta::ChatKitWorkflow::state_variable]?, + tracing: OpenAI::Beta::ChatKitWorkflow::Tracing, + version: String? + ) -> void + + def to_hash: -> { + id: String, + state_variables: ::Hash[Symbol, OpenAI::Models::Beta::ChatKitWorkflow::state_variable]?, + tracing: OpenAI::Beta::ChatKitWorkflow::Tracing, + version: String? + } + + type state_variable = String | bool | Float + + module StateVariable + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Beta::ChatKitWorkflow::state_variable] + end + + type tracing = { enabled: bool } + + class Tracing < OpenAI::Internal::Type::BaseModel + attr_accessor enabled: bool + + def initialize: (enabled: bool) -> void + + def to_hash: -> { enabled: bool } + end + end + end + end +end diff --git a/sig/openai/models/beta/file_part.rbs b/sig/openai/models/beta/file_part.rbs new file mode 100644 index 00000000..53097ebd --- /dev/null +++ b/sig/openai/models/beta/file_part.rbs @@ -0,0 +1,42 @@ +module OpenAI + module Models + module Beta + type file_part = + { + id: String, + mime_type: String?, + name: String?, + type: :file, + upload_url: String? + } + + class FilePart < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor mime_type: String? + + attr_accessor name: String? + + attr_accessor type: :file + + attr_accessor upload_url: String? + + def initialize: ( + id: String, + mime_type: String?, + name: String?, + upload_url: String?, + ?type: :file + ) -> void + + def to_hash: -> { + id: String, + mime_type: String?, + name: String?, + type: :file, + upload_url: String? + } + end + end + end +end diff --git a/sig/openai/models/beta/image_part.rbs b/sig/openai/models/beta/image_part.rbs new file mode 100644 index 00000000..b7391716 --- /dev/null +++ b/sig/openai/models/beta/image_part.rbs @@ -0,0 +1,47 @@ +module OpenAI + module Models + module Beta + type image_part = + { + id: String, + mime_type: String, + name: String?, + preview_url: String, + type: :image, + upload_url: String? + } + + class ImagePart < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor mime_type: String + + attr_accessor name: String? + + attr_accessor preview_url: String + + attr_accessor type: :image + + attr_accessor upload_url: String? + + def initialize: ( + id: String, + mime_type: String, + name: String?, + preview_url: String, + upload_url: String?, + ?type: :image + ) -> void + + def to_hash: -> { + id: String, + mime_type: String, + name: String?, + preview_url: String, + type: :image, + upload_url: String? + } + end + end + end +end diff --git a/sig/openai/models/image_model.rbs b/sig/openai/models/image_model.rbs index e41f713d..667d3331 100644 --- a/sig/openai/models/image_model.rbs +++ b/sig/openai/models/image_model.rbs @@ -1,6 +1,7 @@ module OpenAI module Models - type image_model = :"dall-e-2" | :"dall-e-3" | :"gpt-image-1" + type image_model = + :"dall-e-2" | :"dall-e-3" | :"gpt-image-1" | :"gpt-image-1-mini" module ImageModel extend OpenAI::Internal::Type::Enum @@ -8,6 +9,7 @@ module OpenAI DALL_E_2: :"dall-e-2" DALL_E_3: :"dall-e-3" GPT_IMAGE_1: :"gpt-image-1" + GPT_IMAGE_1_MINI: :"gpt-image-1-mini" def self?.values: -> ::Array[OpenAI::Models::image_model] end diff --git a/sig/openai/models/realtime/realtime_session.rbs b/sig/openai/models/realtime/realtime_session.rbs index 480c4857..cb86db26 100644 --- a/sig/openai/models/realtime/realtime_session.rbs +++ b/sig/openai/models/realtime/realtime_session.rbs @@ -229,6 +229,10 @@ module OpenAI | :"gpt-4o-realtime-preview-2025-06-03" | :"gpt-4o-mini-realtime-preview" | :"gpt-4o-mini-realtime-preview-2024-12-17" + | :"gpt-realtime-mini" + | :"gpt-realtime-mini-2025-10-06" + | :"gpt-audio-mini" + | :"gpt-audio-mini-2025-10-06" module Model extend OpenAI::Internal::Type::Enum @@ -241,6 +245,10 @@ module OpenAI GPT_4O_REALTIME_PREVIEW_2025_06_03: :"gpt-4o-realtime-preview-2025-06-03" GPT_4O_MINI_REALTIME_PREVIEW: :"gpt-4o-mini-realtime-preview" GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17: :"gpt-4o-mini-realtime-preview-2024-12-17" + GPT_REALTIME_MINI: :"gpt-realtime-mini" + GPT_REALTIME_MINI_2025_10_06: :"gpt-realtime-mini-2025-10-06" + GPT_AUDIO_MINI: :"gpt-audio-mini" + GPT_AUDIO_MINI_2025_10_06: :"gpt-audio-mini-2025-10-06" def self?.values: -> ::Array[OpenAI::Models::Realtime::RealtimeSession::model] end diff --git a/sig/openai/models/realtime/realtime_session_create_request.rbs b/sig/openai/models/realtime/realtime_session_create_request.rbs index d7db4531..be94caad 100644 --- a/sig/openai/models/realtime/realtime_session_create_request.rbs +++ b/sig/openai/models/realtime/realtime_session_create_request.rbs @@ -134,6 +134,10 @@ module OpenAI | :"gpt-4o-realtime-preview-2025-06-03" | :"gpt-4o-mini-realtime-preview" | :"gpt-4o-mini-realtime-preview-2024-12-17" + | :"gpt-realtime-mini" + | :"gpt-realtime-mini-2025-10-06" + | :"gpt-audio-mini" + | :"gpt-audio-mini-2025-10-06" module Model extend OpenAI::Internal::Type::Union @@ -148,6 +152,10 @@ module OpenAI GPT_4O_REALTIME_PREVIEW_2025_06_03: :"gpt-4o-realtime-preview-2025-06-03" GPT_4O_MINI_REALTIME_PREVIEW: :"gpt-4o-mini-realtime-preview" GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17: :"gpt-4o-mini-realtime-preview-2024-12-17" + GPT_REALTIME_MINI: :"gpt-realtime-mini" + GPT_REALTIME_MINI_2025_10_06: :"gpt-realtime-mini-2025-10-06" + GPT_AUDIO_MINI: :"gpt-audio-mini" + GPT_AUDIO_MINI_2025_10_06: :"gpt-audio-mini-2025-10-06" end type output_modality = :text | :audio diff --git a/sig/openai/models/realtime/realtime_session_create_response.rbs b/sig/openai/models/realtime/realtime_session_create_response.rbs index e4daa170..b35c2498 100644 --- a/sig/openai/models/realtime/realtime_session_create_response.rbs +++ b/sig/openai/models/realtime/realtime_session_create_response.rbs @@ -421,6 +421,10 @@ module OpenAI | :"gpt-4o-realtime-preview-2025-06-03" | :"gpt-4o-mini-realtime-preview" | :"gpt-4o-mini-realtime-preview-2024-12-17" + | :"gpt-realtime-mini" + | :"gpt-realtime-mini-2025-10-06" + | :"gpt-audio-mini" + | :"gpt-audio-mini-2025-10-06" module Model extend OpenAI::Internal::Type::Union @@ -435,6 +439,10 @@ module OpenAI GPT_4O_REALTIME_PREVIEW_2025_06_03: :"gpt-4o-realtime-preview-2025-06-03" GPT_4O_MINI_REALTIME_PREVIEW: :"gpt-4o-mini-realtime-preview" GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17: :"gpt-4o-mini-realtime-preview-2024-12-17" + GPT_REALTIME_MINI: :"gpt-realtime-mini" + GPT_REALTIME_MINI_2025_10_06: :"gpt-realtime-mini-2025-10-06" + GPT_AUDIO_MINI: :"gpt-audio-mini" + GPT_AUDIO_MINI_2025_10_06: :"gpt-audio-mini-2025-10-06" end type output_modality = :text | :audio diff --git a/sig/openai/models/responses/tool.rbs b/sig/openai/models/responses/tool.rbs index 6e0b68f1..27f20f94 100644 --- a/sig/openai/models/responses/tool.rbs +++ b/sig/openai/models/responses/tool.rbs @@ -413,12 +413,13 @@ module OpenAI def to_hash: -> { file_id: String, image_url: String } end - type model = :"gpt-image-1" + type model = :"gpt-image-1" | :"gpt-image-1-mini" module Model extend OpenAI::Internal::Type::Enum GPT_IMAGE_1: :"gpt-image-1" + GPT_IMAGE_1_MINI: :"gpt-image-1-mini" def self?.values: -> ::Array[OpenAI::Models::Responses::Tool::ImageGeneration::model] end diff --git a/sig/openai/models/responses_model.rbs b/sig/openai/models/responses_model.rbs index 839b54c0..985ecc6e 100644 --- a/sig/openai/models/responses_model.rbs +++ b/sig/openai/models/responses_model.rbs @@ -20,6 +20,8 @@ module OpenAI | :"computer-use-preview" | :"computer-use-preview-2025-03-11" | :"gpt-5-codex" + | :"gpt-5-pro" + | :"gpt-5-pro-2025-10-06" module ResponsesOnlyModel extend OpenAI::Internal::Type::Enum @@ -35,6 +37,8 @@ module OpenAI COMPUTER_USE_PREVIEW: :"computer-use-preview" COMPUTER_USE_PREVIEW_2025_03_11: :"computer-use-preview-2025-03-11" GPT_5_CODEX: :"gpt-5-codex" + GPT_5_PRO: :"gpt-5-pro" + GPT_5_PRO_2025_10_06: :"gpt-5-pro-2025-10-06" def self?.values: -> ::Array[OpenAI::Models::ResponsesModel::responses_only_model] end diff --git a/sig/openai/models/video.rbs b/sig/openai/models/video.rbs new file mode 100644 index 00000000..91e3be95 --- /dev/null +++ b/sig/openai/models/video.rbs @@ -0,0 +1,88 @@ +module OpenAI + module Models + type video = + { + id: String, + completed_at: Integer?, + created_at: Integer, + error: OpenAI::VideoCreateError?, + expires_at: Integer?, + model: OpenAI::Models::video_model, + object: :video, + progress: Integer, + remixed_from_video_id: String?, + seconds: OpenAI::Models::video_seconds, + size: OpenAI::Models::video_size, + status: OpenAI::Models::Video::status + } + + class Video < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor completed_at: Integer? + + attr_accessor created_at: Integer + + attr_accessor error: OpenAI::VideoCreateError? + + attr_accessor expires_at: Integer? + + attr_accessor model: OpenAI::Models::video_model + + attr_accessor object: :video + + attr_accessor progress: Integer + + attr_accessor remixed_from_video_id: String? + + attr_accessor seconds: OpenAI::Models::video_seconds + + attr_accessor size: OpenAI::Models::video_size + + attr_accessor status: OpenAI::Models::Video::status + + def initialize: ( + id: String, + completed_at: Integer?, + created_at: Integer, + error: OpenAI::VideoCreateError?, + expires_at: Integer?, + model: OpenAI::Models::video_model, + progress: Integer, + remixed_from_video_id: String?, + seconds: OpenAI::Models::video_seconds, + size: OpenAI::Models::video_size, + status: OpenAI::Models::Video::status, + ?object: :video + ) -> void + + def to_hash: -> { + id: String, + completed_at: Integer?, + created_at: Integer, + error: OpenAI::VideoCreateError?, + expires_at: Integer?, + model: OpenAI::Models::video_model, + object: :video, + progress: Integer, + remixed_from_video_id: String?, + seconds: OpenAI::Models::video_seconds, + size: OpenAI::Models::video_size, + status: OpenAI::Models::Video::status + } + + type status = :queued | :in_progress | :completed | :failed + + module Status + extend OpenAI::Internal::Type::Enum + + QUEUED: :queued + IN_PROGRESS: :in_progress + COMPLETED: :completed + FAILED: :failed + + def self?.values: -> ::Array[OpenAI::Models::Video::status] + end + end + end +end diff --git a/sig/openai/models/video_create_error.rbs b/sig/openai/models/video_create_error.rbs new file mode 100644 index 00000000..95da8a0d --- /dev/null +++ b/sig/openai/models/video_create_error.rbs @@ -0,0 +1,15 @@ +module OpenAI + module Models + type video_create_error = { code: String, message: String } + + class VideoCreateError < OpenAI::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor message: String + + def initialize: (code: String, message: String) -> void + + def to_hash: -> { code: String, message: String } + end + end +end diff --git a/sig/openai/models/video_create_params.rbs b/sig/openai/models/video_create_params.rbs new file mode 100644 index 00000000..da82a55b --- /dev/null +++ b/sig/openai/models/video_create_params.rbs @@ -0,0 +1,58 @@ +module OpenAI + module Models + type video_create_params = + { + prompt: String, + input_reference: OpenAI::Internal::file_input, + model: OpenAI::Models::video_model, + seconds: OpenAI::Models::video_seconds, + size: OpenAI::Models::video_size + } + & OpenAI::Internal::Type::request_parameters + + class VideoCreateParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + attr_accessor prompt: String + + attr_reader input_reference: OpenAI::Internal::file_input? + + def input_reference=: ( + OpenAI::Internal::file_input + ) -> OpenAI::Internal::file_input + + attr_reader model: OpenAI::Models::video_model? + + def model=: (OpenAI::Models::video_model) -> OpenAI::Models::video_model + + attr_reader seconds: OpenAI::Models::video_seconds? + + def seconds=: ( + OpenAI::Models::video_seconds + ) -> OpenAI::Models::video_seconds + + attr_reader size: OpenAI::Models::video_size? + + def size=: (OpenAI::Models::video_size) -> OpenAI::Models::video_size + + def initialize: ( + prompt: String, + ?input_reference: OpenAI::Internal::file_input, + ?model: OpenAI::Models::video_model, + ?seconds: OpenAI::Models::video_seconds, + ?size: OpenAI::Models::video_size, + ?request_options: OpenAI::request_opts + ) -> void + + def to_hash: -> { + prompt: String, + input_reference: OpenAI::Internal::file_input, + model: OpenAI::Models::video_model, + seconds: OpenAI::Models::video_seconds, + size: OpenAI::Models::video_size, + request_options: OpenAI::RequestOptions + } + end + end +end diff --git a/sig/openai/models/video_delete_params.rbs b/sig/openai/models/video_delete_params.rbs new file mode 100644 index 00000000..e90c1517 --- /dev/null +++ b/sig/openai/models/video_delete_params.rbs @@ -0,0 +1,14 @@ +module OpenAI + module Models + type video_delete_params = { } & OpenAI::Internal::Type::request_parameters + + class VideoDeleteParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + def initialize: (?request_options: OpenAI::request_opts) -> void + + def to_hash: -> { request_options: OpenAI::RequestOptions } + end + end +end diff --git a/sig/openai/models/video_delete_response.rbs b/sig/openai/models/video_delete_response.rbs new file mode 100644 index 00000000..5ff88a1c --- /dev/null +++ b/sig/openai/models/video_delete_response.rbs @@ -0,0 +1,22 @@ +module OpenAI + module Models + type video_delete_response = + { id: String, deleted: bool, object: :"video.deleted" } + + class VideoDeleteResponse < OpenAI::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor deleted: bool + + attr_accessor object: :"video.deleted" + + def initialize: ( + id: String, + deleted: bool, + ?object: :"video.deleted" + ) -> void + + def to_hash: -> { id: String, deleted: bool, object: :"video.deleted" } + end + end +end diff --git a/sig/openai/models/video_download_content_params.rbs b/sig/openai/models/video_download_content_params.rbs new file mode 100644 index 00000000..8f7696c7 --- /dev/null +++ b/sig/openai/models/video_download_content_params.rbs @@ -0,0 +1,40 @@ +module OpenAI + module Models + type video_download_content_params = + { variant: OpenAI::Models::VideoDownloadContentParams::variant } + & OpenAI::Internal::Type::request_parameters + + class VideoDownloadContentParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + attr_reader variant: OpenAI::Models::VideoDownloadContentParams::variant? + + def variant=: ( + OpenAI::Models::VideoDownloadContentParams::variant + ) -> OpenAI::Models::VideoDownloadContentParams::variant + + def initialize: ( + ?variant: OpenAI::Models::VideoDownloadContentParams::variant, + ?request_options: OpenAI::request_opts + ) -> void + + def to_hash: -> { + variant: OpenAI::Models::VideoDownloadContentParams::variant, + request_options: OpenAI::RequestOptions + } + + type variant = :video | :thumbnail | :spritesheet + + module Variant + extend OpenAI::Internal::Type::Enum + + VIDEO: :video + THUMBNAIL: :thumbnail + SPRITESHEET: :spritesheet + + def self?.values: -> ::Array[OpenAI::Models::VideoDownloadContentParams::variant] + end + end + end +end diff --git a/sig/openai/models/video_list_params.rbs b/sig/openai/models/video_list_params.rbs new file mode 100644 index 00000000..b560eb51 --- /dev/null +++ b/sig/openai/models/video_list_params.rbs @@ -0,0 +1,55 @@ +module OpenAI + module Models + type video_list_params = + { + after: String, + limit: Integer, + order: OpenAI::Models::VideoListParams::order + } + & OpenAI::Internal::Type::request_parameters + + class VideoListParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader order: OpenAI::Models::VideoListParams::order? + + def order=: ( + OpenAI::Models::VideoListParams::order + ) -> OpenAI::Models::VideoListParams::order + + def initialize: ( + ?after: String, + ?limit: Integer, + ?order: OpenAI::Models::VideoListParams::order, + ?request_options: OpenAI::request_opts + ) -> void + + def to_hash: -> { + after: String, + limit: Integer, + order: OpenAI::Models::VideoListParams::order, + request_options: OpenAI::RequestOptions + } + + type order = :asc | :desc + + module Order + extend OpenAI::Internal::Type::Enum + + ASC: :asc + DESC: :desc + + def self?.values: -> ::Array[OpenAI::Models::VideoListParams::order] + end + end + end +end diff --git a/sig/openai/models/video_model.rbs b/sig/openai/models/video_model.rbs new file mode 100644 index 00000000..0b22884b --- /dev/null +++ b/sig/openai/models/video_model.rbs @@ -0,0 +1,14 @@ +module OpenAI + module Models + type video_model = :"sora-2" | :"sora-2-pro" + + module VideoModel + extend OpenAI::Internal::Type::Enum + + SORA_2: :"sora-2" + SORA_2_PRO: :"sora-2-pro" + + def self?.values: -> ::Array[OpenAI::Models::video_model] + end + end +end diff --git a/sig/openai/models/video_remix_params.rbs b/sig/openai/models/video_remix_params.rbs new file mode 100644 index 00000000..ee442bcc --- /dev/null +++ b/sig/openai/models/video_remix_params.rbs @@ -0,0 +1,23 @@ +module OpenAI + module Models + type video_remix_params = + { prompt: String } & OpenAI::Internal::Type::request_parameters + + class VideoRemixParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + attr_accessor prompt: String + + def initialize: ( + prompt: String, + ?request_options: OpenAI::request_opts + ) -> void + + def to_hash: -> { + prompt: String, + request_options: OpenAI::RequestOptions + } + end + end +end diff --git a/sig/openai/models/video_retrieve_params.rbs b/sig/openai/models/video_retrieve_params.rbs new file mode 100644 index 00000000..5f261ce0 --- /dev/null +++ b/sig/openai/models/video_retrieve_params.rbs @@ -0,0 +1,15 @@ +module OpenAI + module Models + type video_retrieve_params = + { } & OpenAI::Internal::Type::request_parameters + + class VideoRetrieveParams < OpenAI::Internal::Type::BaseModel + extend OpenAI::Internal::Type::RequestParameters::Converter + include OpenAI::Internal::Type::RequestParameters + + def initialize: (?request_options: OpenAI::request_opts) -> void + + def to_hash: -> { request_options: OpenAI::RequestOptions } + end + end +end diff --git a/sig/openai/models/video_seconds.rbs b/sig/openai/models/video_seconds.rbs new file mode 100644 index 00000000..33f9672e --- /dev/null +++ b/sig/openai/models/video_seconds.rbs @@ -0,0 +1,15 @@ +module OpenAI + module Models + type video_seconds = :"4" | :"8" | :"12" + + module VideoSeconds + extend OpenAI::Internal::Type::Enum + + VIDEO_SECONDS_4: :"4" + VIDEO_SECONDS_8: :"8" + VIDEO_SECONDS_12: :"12" + + def self?.values: -> ::Array[OpenAI::Models::video_seconds] + end + end +end diff --git a/sig/openai/models/video_size.rbs b/sig/openai/models/video_size.rbs new file mode 100644 index 00000000..f9c64e61 --- /dev/null +++ b/sig/openai/models/video_size.rbs @@ -0,0 +1,16 @@ +module OpenAI + module Models + type video_size = :"720x1280" | :"1280x720" | :"1024x1792" | :"1792x1024" + + module VideoSize + extend OpenAI::Internal::Type::Enum + + VIDEO_SIZE_720X1280: :"720x1280" + VIDEO_SIZE_1280X720: :"1280x720" + VIDEO_SIZE_1024X1792: :"1024x1792" + VIDEO_SIZE_1792X1024: :"1792x1024" + + def self?.values: -> ::Array[OpenAI::Models::video_size] + end + end +end diff --git a/sig/openai/resources/beta.rbs b/sig/openai/resources/beta.rbs index 92513f55..25071b2a 100644 --- a/sig/openai/resources/beta.rbs +++ b/sig/openai/resources/beta.rbs @@ -1,6 +1,8 @@ module OpenAI module Resources class Beta + attr_reader chatkit: OpenAI::Resources::Beta::ChatKit + attr_reader assistants: OpenAI::Resources::Beta::Assistants attr_reader threads: OpenAI::Resources::Beta::Threads diff --git a/sig/openai/resources/beta/chatkit.rbs b/sig/openai/resources/beta/chatkit.rbs new file mode 100644 index 00000000..5a6e7d73 --- /dev/null +++ b/sig/openai/resources/beta/chatkit.rbs @@ -0,0 +1,18 @@ +module OpenAI + module Resources + class Beta + class ChatKit + attr_reader sessions: OpenAI::Resources::Beta::ChatKit::Sessions + + attr_reader threads: OpenAI::Resources::Beta::ChatKit::Threads + + def upload_file: ( + file: OpenAI::Internal::file_input, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Models::Beta::chatkit_upload_file_response + + def initialize: (client: OpenAI::Client) -> void + end + end + end +end diff --git a/sig/openai/resources/beta/chatkit/sessions.rbs b/sig/openai/resources/beta/chatkit/sessions.rbs new file mode 100644 index 00000000..9bf8f32b --- /dev/null +++ b/sig/openai/resources/beta/chatkit/sessions.rbs @@ -0,0 +1,25 @@ +module OpenAI + module Resources + class Beta + class ChatKit + class Sessions + def create: ( + user: String, + workflow: OpenAI::Beta::ChatKit::ChatSessionWorkflowParam, + ?chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam, + ?expires_after: OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam, + ?rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimitsParam, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Beta::ChatKit::ChatSession + + def cancel: ( + String session_id, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Beta::ChatKit::ChatSession + + def initialize: (client: OpenAI::Client) -> void + end + end + end + end +end diff --git a/sig/openai/resources/beta/chatkit/threads.rbs b/sig/openai/resources/beta/chatkit/threads.rbs new file mode 100644 index 00000000..015192a7 --- /dev/null +++ b/sig/openai/resources/beta/chatkit/threads.rbs @@ -0,0 +1,39 @@ +module OpenAI + module Resources + class Beta + class ChatKit + class Threads + def retrieve: ( + String thread_id, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Beta::ChatKit::ChatKitThread + + def list: ( + ?after: String, + ?before: String, + ?limit: Integer, + ?order: OpenAI::Models::Beta::ChatKit::ThreadListParams::order, + ?user: String, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Internal::ConversationCursorPage[OpenAI::Beta::ChatKit::ChatKitThread] + + def delete: ( + String thread_id, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Models::Beta::ChatKit::ThreadDeleteResponse + + def list_items: ( + String thread_id, + ?after: String, + ?before: String, + ?limit: Integer, + ?order: OpenAI::Models::Beta::ChatKit::ThreadListItemsParams::order, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Internal::ConversationCursorPage[OpenAI::Models::Beta::ChatKit::ChatKitThreadItemList::data] + + def initialize: (client: OpenAI::Client) -> void + end + end + end + end +end diff --git a/sig/openai/resources/videos.rbs b/sig/openai/resources/videos.rbs new file mode 100644 index 00000000..bc868a63 --- /dev/null +++ b/sig/openai/resources/videos.rbs @@ -0,0 +1,45 @@ +module OpenAI + module Resources + class Videos + def create: ( + prompt: String, + ?input_reference: OpenAI::Internal::file_input, + ?model: OpenAI::Models::video_model, + ?seconds: OpenAI::Models::video_seconds, + ?size: OpenAI::Models::video_size, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Video + + def retrieve: ( + String video_id, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Video + + def list: ( + ?after: String, + ?limit: Integer, + ?order: OpenAI::Models::VideoListParams::order, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Internal::ConversationCursorPage[OpenAI::Video] + + def delete: ( + String video_id, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Models::VideoDeleteResponse + + def download_content: ( + String video_id, + ?variant: OpenAI::Models::VideoDownloadContentParams::variant, + ?request_options: OpenAI::request_opts + ) -> StringIO + + def remix: ( + String video_id, + prompt: String, + ?request_options: OpenAI::request_opts + ) -> OpenAI::Video + + def initialize: (client: OpenAI::Client) -> void + end + end +end diff --git a/test/openai/resource_namespaces.rb b/test/openai/resource_namespaces.rb index 65835fbd..ffa7a9d9 100644 --- a/test/openai/resource_namespaces.rb +++ b/test/openai/resource_namespaces.rb @@ -10,6 +10,9 @@ module Audio end module Beta + module ChatKit + end + module Threads module Runs end @@ -21,6 +24,9 @@ module Completions end end + module ChatKit + end + module Checkpoints end diff --git a/test/openai/resources/beta/chatkit/sessions_test.rb b/test/openai/resources/beta/chatkit/sessions_test.rb new file mode 100644 index 00000000..4013b14b --- /dev/null +++ b/test/openai/resources/beta/chatkit/sessions_test.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class OpenAI::Test::Resources::Beta::ChatKit::SessionsTest < OpenAI::Test::ResourceTest + def test_create_required_params + response = @openai.beta.chatkit.sessions.create(user: "x", workflow: {id: "id"}) + + assert_pattern do + response => OpenAI::Beta::ChatKit::ChatSession + end + + assert_pattern do + response => { + id: String, + chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration, + client_secret: String, + expires_at: Integer, + max_requests_per_1_minute: Integer, + object: Symbol, + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits, + status: OpenAI::Beta::ChatKit::ChatSessionStatus, + user: String, + workflow: OpenAI::Beta::ChatKitWorkflow + } + end + end + + def test_cancel + response = @openai.beta.chatkit.sessions.cancel("cksess_123") + + assert_pattern do + response => OpenAI::Beta::ChatKit::ChatSession + end + + assert_pattern do + response => { + id: String, + chatkit_configuration: OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration, + client_secret: String, + expires_at: Integer, + max_requests_per_1_minute: Integer, + object: Symbol, + rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits, + status: OpenAI::Beta::ChatKit::ChatSessionStatus, + user: String, + workflow: OpenAI::Beta::ChatKitWorkflow + } + end + end +end diff --git a/test/openai/resources/beta/chatkit/threads_test.rb b/test/openai/resources/beta/chatkit/threads_test.rb new file mode 100644 index 00000000..9104dce8 --- /dev/null +++ b/test/openai/resources/beta/chatkit/threads_test.rb @@ -0,0 +1,146 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class OpenAI::Test::Resources::Beta::ChatKit::ThreadsTest < OpenAI::Test::ResourceTest + def test_retrieve + response = @openai.beta.chatkit.threads.retrieve("cthr_123") + + assert_pattern do + response => OpenAI::Beta::ChatKit::ChatKitThread + end + + assert_pattern do + response => { + id: String, + created_at: Integer, + object: Symbol, + status: OpenAI::Beta::ChatKit::ChatKitThread::Status, + title: String | nil, + user: String + } + end + end + + def test_list + response = @openai.beta.chatkit.threads.list + + assert_pattern do + response => OpenAI::Internal::ConversationCursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => OpenAI::Beta::ChatKit::ChatKitThread + end + + assert_pattern do + row => { + id: String, + created_at: Integer, + object: Symbol, + status: OpenAI::Beta::ChatKit::ChatKitThread::Status, + title: String | nil, + user: String + } + end + end + + def test_delete + response = @openai.beta.chatkit.threads.delete("cthr_123") + + assert_pattern do + response => OpenAI::Models::Beta::ChatKit::ThreadDeleteResponse + end + + assert_pattern do + response => { + id: String, + deleted: OpenAI::Internal::Type::Boolean, + object: Symbol + } + end + end + + def test_list_items + response = @openai.beta.chatkit.threads.list_items("cthr_123") + + assert_pattern do + response => OpenAI::Internal::ConversationCursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data + end + + assert_pattern do + case row + in OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem + in OpenAI::Beta::ChatKit::ChatKitThreadAssistantMessageItem + in OpenAI::Beta::ChatKit::ChatKitWidgetItem + in OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall + in OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask + in OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup + end + end + + assert_pattern do + case row + in { + type: :"chatkit.user_message", + id: String, + attachments: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitAttachment]), + content: ^(OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::Content]), + created_at: Integer, + inference_options: OpenAI::Beta::ChatKit::ChatKitThreadUserMessageItem::InferenceOptions | nil, + object: Symbol, + thread_id: String + } + in { + type: :"chatkit.assistant_message", + id: String, + content: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitResponseOutputText]), + created_at: Integer, + object: Symbol, + thread_id: String + } + in {type: :"chatkit.widget", id: String, created_at: Integer, object: Symbol, thread_id: String, widget: String} + in { + type: :"chatkit.client_tool_call", + id: String, + arguments: String, + call_id: String, + created_at: Integer, + name: String, + object: Symbol, + output: String | nil, + status: OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitClientToolCall::Status, + thread_id: String + } + in { + type: :"chatkit.task", + id: String, + created_at: Integer, + heading: String | nil, + object: Symbol, + summary: String | nil, + task_type: OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTask::TaskType, + thread_id: String + } + in { + type: :"chatkit.task_group", + id: String, + created_at: Integer, + object: Symbol, + tasks: ^(OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitThreadItemList::Data::ChatKitTaskGroup::Task]), + thread_id: String + } + end + end + end +end diff --git a/test/openai/resources/beta/chatkit_test.rb b/test/openai/resources/beta/chatkit_test.rb new file mode 100644 index 00000000..2a40365b --- /dev/null +++ b/test/openai/resources/beta/chatkit_test.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class OpenAI::Test::Resources::Beta::ChatKitTest < OpenAI::Test::ResourceTest + def test_upload_file_required_params + response = @openai.beta.chatkit.upload_file(file: Pathname(__FILE__)) + + assert_pattern do + response => OpenAI::Models::Beta::ChatKitUploadFileResponse + end + + assert_pattern do + case response + in OpenAI::Beta::FilePart + in OpenAI::Beta::ImagePart + end + end + + assert_pattern do + case response + in {type: :file, id: String, mime_type: String | nil, name: String | nil, upload_url: String | nil} + in {type: :image, id: String, mime_type: String, name: String | nil, preview_url: String, upload_url: String | nil} + end + end + end +end diff --git a/test/openai/resources/videos_test.rb b/test/openai/resources/videos_test.rb new file mode 100644 index 00000000..4ea56365 --- /dev/null +++ b/test/openai/resources/videos_test.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class OpenAI::Test::Resources::VideosTest < OpenAI::Test::ResourceTest + def test_create_required_params + response = @openai.videos.create(prompt: "x") + + assert_pattern do + response => OpenAI::Video + end + + assert_pattern do + response => { + id: String, + completed_at: Integer | nil, + created_at: Integer, + error: OpenAI::VideoCreateError | nil, + expires_at: Integer | nil, + model: OpenAI::VideoModel, + object: Symbol, + progress: Integer, + remixed_from_video_id: String | nil, + seconds: OpenAI::VideoSeconds, + size: OpenAI::VideoSize, + status: OpenAI::Video::Status + } + end + end + + def test_retrieve + response = @openai.videos.retrieve("video_123") + + assert_pattern do + response => OpenAI::Video + end + + assert_pattern do + response => { + id: String, + completed_at: Integer | nil, + created_at: Integer, + error: OpenAI::VideoCreateError | nil, + expires_at: Integer | nil, + model: OpenAI::VideoModel, + object: Symbol, + progress: Integer, + remixed_from_video_id: String | nil, + seconds: OpenAI::VideoSeconds, + size: OpenAI::VideoSize, + status: OpenAI::Video::Status + } + end + end + + def test_list + response = @openai.videos.list + + assert_pattern do + response => OpenAI::Internal::ConversationCursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => OpenAI::Video + end + + assert_pattern do + row => { + id: String, + completed_at: Integer | nil, + created_at: Integer, + error: OpenAI::VideoCreateError | nil, + expires_at: Integer | nil, + model: OpenAI::VideoModel, + object: Symbol, + progress: Integer, + remixed_from_video_id: String | nil, + seconds: OpenAI::VideoSeconds, + size: OpenAI::VideoSize, + status: OpenAI::Video::Status + } + end + end + + def test_delete + response = @openai.videos.delete("video_123") + + assert_pattern do + response => OpenAI::Models::VideoDeleteResponse + end + + assert_pattern do + response => { + id: String, + deleted: OpenAI::Internal::Type::Boolean, + object: Symbol + } + end + end + + def test_download_content + skip("Prism doesn't support application/binary responses") + + response = @openai.videos.download_content("video_123") + + assert_pattern do + response => StringIO + end + end + + def test_remix_required_params + response = @openai.videos.remix("video_123", prompt: "x") + + assert_pattern do + response => OpenAI::Video + end + + assert_pattern do + response => { + id: String, + completed_at: Integer | nil, + created_at: Integer, + error: OpenAI::VideoCreateError | nil, + expires_at: Integer | nil, + model: OpenAI::VideoModel, + object: Symbol, + progress: Integer, + remixed_from_video_id: String | nil, + seconds: OpenAI::VideoSeconds, + size: OpenAI::VideoSize, + status: OpenAI::Video::Status + } + end + end +end From 556ab0789e7dea77c60e35f56d3ecc6c16ecb4c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:49:15 +0000 Subject: [PATCH 2/2] release: 0.30.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/openai/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b8dda9bf..554e34bb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.29.0" + ".": "0.30.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c9f596e..ad2d911a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.30.0 (2025-10-06) + +Full Changelog: [v0.29.0...v0.30.0](https://github.com/openai/openai-ruby/compare/v0.29.0...v0.30.0) + +### Features + +* **api:** dev day 2025 launches ([98a56b4](https://github.com/openai/openai-ruby/commit/98a56b4c6a1cae0ebf4c0d9bc75933fbcd74af9f)) + ## 0.29.0 (2025-10-02) Full Changelog: [v0.28.1...v0.29.0](https://github.com/openai/openai-ruby/compare/v0.28.1...v0.29.0) diff --git a/Gemfile.lock b/Gemfile.lock index cb62acc6..9d3559ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - openai (0.29.0) + openai (0.30.0) connection_pool GEM diff --git a/README.md b/README.md index dd7a2a72..6a5eacc9 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "openai", "~> 0.29.0" +gem "openai", "~> 0.30.0" ``` diff --git a/lib/openai/version.rb b/lib/openai/version.rb index ad6e4b51..417d3f9a 100644 --- a/lib/openai/version.rb +++ b/lib/openai/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module OpenAI - VERSION = "0.29.0" + VERSION = "0.30.0" end