openai 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +4 -0
- data/lib/openai/internal/conversation_cursor_page.rb +2 -2
- data/lib/openai/models/all_models.rb +2 -0
- data/lib/openai/models/beta/chatkit/chat_session.rb +94 -0
- data/lib/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rb +22 -0
- data/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration.rb +38 -0
- data/lib/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rb +125 -0
- data/lib/openai/models/beta/chatkit/chat_session_expires_after_param.rb +30 -0
- data/lib/openai/models/beta/chatkit/chat_session_file_upload.rb +38 -0
- data/lib/openai/models/beta/chatkit/chat_session_history.rb +34 -0
- data/lib/openai/models/beta/chatkit/chat_session_rate_limits.rb +22 -0
- data/lib/openai/models/beta/chatkit/chat_session_rate_limits_param.rb +22 -0
- data/lib/openai/models/beta/chatkit/chat_session_status.rb +20 -0
- data/lib/openai/models/beta/chatkit/chat_session_workflow_param.rb +80 -0
- data/lib/openai/models/beta/chatkit/chatkit_attachment.rb +69 -0
- data/lib/openai/models/beta/chatkit/chatkit_response_output_text.rb +143 -0
- data/lib/openai/models/beta/chatkit/chatkit_thread.rb +145 -0
- data/lib/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rb +65 -0
- data/lib/openai/models/beta/chatkit/chatkit_thread_item_list.rb +374 -0
- data/lib/openai/models/beta/chatkit/chatkit_thread_user_message_item.rb +183 -0
- data/lib/openai/models/beta/chatkit/chatkit_widget_item.rb +64 -0
- data/lib/openai/models/beta/chatkit/session_cancel_params.rb +18 -0
- data/lib/openai/models/beta/chatkit/session_create_params.rb +63 -0
- data/lib/openai/models/beta/chatkit/thread_delete_params.rb +18 -0
- data/lib/openai/models/beta/chatkit/thread_delete_response.rb +39 -0
- data/lib/openai/models/beta/chatkit/thread_list_items_params.rb +66 -0
- data/lib/openai/models/beta/chatkit/thread_list_params.rb +75 -0
- data/lib/openai/models/beta/chatkit/thread_retrieve_params.rb +18 -0
- data/lib/openai/models/beta/chatkit_upload_file_params.rb +28 -0
- data/lib/openai/models/beta/chatkit_upload_file_response.rb +25 -0
- data/lib/openai/models/beta/chatkit_workflow.rb +78 -0
- data/lib/openai/models/beta/file_part.rb +56 -0
- data/lib/openai/models/beta/image_part.rb +64 -0
- data/lib/openai/models/image_edit_params.rb +4 -2
- data/lib/openai/models/image_model.rb +1 -0
- data/lib/openai/models/realtime/realtime_session.rb +4 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +12 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +12 -0
- data/lib/openai/models/responses/tool.rb +5 -2
- data/lib/openai/models/responses_model.rb +2 -0
- data/lib/openai/models/video.rb +122 -0
- data/lib/openai/models/video_create_error.rb +21 -0
- data/lib/openai/models/video_create_params.rb +54 -0
- data/lib/openai/models/video_delete_params.rb +14 -0
- data/lib/openai/models/video_delete_response.rb +35 -0
- data/lib/openai/models/video_download_content_params.rb +34 -0
- data/lib/openai/models/video_list_params.rb +54 -0
- data/lib/openai/models/video_model.rb +15 -0
- data/lib/openai/models/video_remix_params.rb +22 -0
- data/lib/openai/models/video_retrieve_params.rb +14 -0
- data/lib/openai/models/video_seconds.rb +16 -0
- data/lib/openai/models/video_size.rb +17 -0
- data/lib/openai/models.rb +22 -0
- data/lib/openai/resources/beta/chatkit/sessions.rb +71 -0
- data/lib/openai/resources/beta/chatkit/threads.rb +126 -0
- data/lib/openai/resources/beta/chatkit.rb +50 -0
- data/lib/openai/resources/beta.rb +4 -0
- data/lib/openai/resources/videos.rb +165 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +46 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/models/all_models.rbi +10 -0
- data/rbi/openai/models/beta/chatkit/chat_session.rbi +141 -0
- data/rbi/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbi +35 -0
- data/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbi +87 -0
- data/rbi/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbi +256 -0
- data/rbi/openai/models/beta/chatkit/chat_session_expires_after_param.rbi +43 -0
- data/rbi/openai/models/beta/chatkit/chat_session_file_upload.rbi +61 -0
- data/rbi/openai/models/beta/chatkit/chat_session_history.rbi +52 -0
- data/rbi/openai/models/beta/chatkit/chat_session_rate_limits.rbi +37 -0
- data/rbi/openai/models/beta/chatkit/chat_session_rate_limits_param.rbi +40 -0
- data/rbi/openai/models/beta/chatkit/chat_session_status.rbi +43 -0
- data/rbi/openai/models/beta/chatkit/chat_session_workflow_param.rbi +166 -0
- data/rbi/openai/models/beta/chatkit/chatkit_attachment.rbi +116 -0
- data/rbi/openai/models/beta/chatkit/chatkit_response_output_text.rbi +287 -0
- data/rbi/openai/models/beta/chatkit/chatkit_thread.rbi +220 -0
- data/rbi/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbi +94 -0
- data/rbi/openai/models/beta/chatkit/chatkit_thread_item_list.rbi +590 -0
- data/rbi/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbi +324 -0
- data/rbi/openai/models/beta/chatkit/chatkit_widget_item.rbi +87 -0
- data/rbi/openai/models/beta/chatkit/session_cancel_params.rbi +34 -0
- data/rbi/openai/models/beta/chatkit/session_create_params.rbi +136 -0
- data/rbi/openai/models/beta/chatkit/thread_delete_params.rbi +34 -0
- data/rbi/openai/models/beta/chatkit/thread_delete_response.rbi +55 -0
- data/rbi/openai/models/beta/chatkit/thread_list_items_params.rbi +138 -0
- data/rbi/openai/models/beta/chatkit/thread_list_params.rbi +145 -0
- data/rbi/openai/models/beta/chatkit/thread_retrieve_params.rbi +34 -0
- data/rbi/openai/models/beta/chatkit_upload_file_params.rbi +50 -0
- data/rbi/openai/models/beta/chatkit_upload_file_response.rbi +25 -0
- data/rbi/openai/models/beta/chatkit_workflow.rbi +134 -0
- data/rbi/openai/models/beta/file_part.rbi +74 -0
- data/rbi/openai/models/beta/image_part.rbi +82 -0
- data/rbi/openai/models/image_edit_params.rbi +6 -3
- data/rbi/openai/models/image_model.rbi +2 -0
- data/rbi/openai/models/realtime/realtime_session.rbi +20 -0
- data/rbi/openai/models/realtime/realtime_session_create_request.rbi +20 -0
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +20 -0
- data/rbi/openai/models/responses/tool.rbi +11 -3
- data/rbi/openai/models/responses_model.rbi +10 -0
- data/rbi/openai/models/video.rbi +143 -0
- data/rbi/openai/models/video_create_error.rbi +26 -0
- data/rbi/openai/models/video_create_params.rbi +87 -0
- data/rbi/openai/models/video_delete_params.rbi +27 -0
- data/rbi/openai/models/video_delete_response.rbi +46 -0
- data/rbi/openai/models/video_download_content_params.rbi +89 -0
- data/rbi/openai/models/video_list_params.rbi +91 -0
- data/rbi/openai/models/video_model.rbi +19 -0
- data/rbi/openai/models/video_remix_params.rbi +40 -0
- data/rbi/openai/models/video_retrieve_params.rbi +27 -0
- data/rbi/openai/models/video_seconds.rbi +20 -0
- data/rbi/openai/models/video_size.rbi +23 -0
- data/rbi/openai/models.rbi +22 -0
- data/rbi/openai/resources/beta/chatkit/sessions.rbi +61 -0
- data/rbi/openai/resources/beta/chatkit/threads.rbi +110 -0
- data/rbi/openai/resources/beta/chatkit.rbi +35 -0
- data/rbi/openai/resources/beta.rbi +3 -0
- data/rbi/openai/resources/images.rbi +4 -2
- data/rbi/openai/resources/videos.rbi +121 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/models/all_models.rbs +4 -0
- data/sig/openai/models/beta/chatkit/chat_session.rbs +69 -0
- data/sig/openai/models/beta/chatkit/chat_session_automatic_thread_titling.rbs +17 -0
- data/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration.rbs +34 -0
- data/sig/openai/models/beta/chatkit/chat_session_chatkit_configuration_param.rbs +103 -0
- data/sig/openai/models/beta/chatkit/chat_session_expires_after_param.rbs +20 -0
- data/sig/openai/models/beta/chatkit/chat_session_file_upload.rbs +30 -0
- data/sig/openai/models/beta/chatkit/chat_session_history.rbs +19 -0
- data/sig/openai/models/beta/chatkit/chat_session_rate_limits.rbs +18 -0
- data/sig/openai/models/beta/chatkit/chat_session_rate_limits_param.rbs +20 -0
- data/sig/openai/models/beta/chatkit/chat_session_status.rbs +19 -0
- data/sig/openai/models/beta/chatkit/chat_session_workflow_param.rbs +69 -0
- data/sig/openai/models/beta/chatkit/chatkit_attachment.rbs +57 -0
- data/sig/openai/models/beta/chatkit/chatkit_response_output_text.rbs +114 -0
- data/sig/openai/models/beta/chatkit/chatkit_thread.rbs +96 -0
- data/sig/openai/models/beta/chatkit/chatkit_thread_assistant_message_item.rbs +51 -0
- data/sig/openai/models/beta/chatkit/chatkit_thread_item_list.rbs +276 -0
- data/sig/openai/models/beta/chatkit/chatkit_thread_user_message_item.rbs +127 -0
- data/sig/openai/models/beta/chatkit/chatkit_widget_item.rbs +51 -0
- data/sig/openai/models/beta/chatkit/session_cancel_params.rbs +19 -0
- data/sig/openai/models/beta/chatkit/session_create_params.rbs +62 -0
- data/sig/openai/models/beta/chatkit/thread_delete_params.rbs +19 -0
- data/sig/openai/models/beta/chatkit/thread_delete_response.rbs +30 -0
- data/sig/openai/models/beta/chatkit/thread_list_items_params.rbs +66 -0
- data/sig/openai/models/beta/chatkit/thread_list_params.rbs +73 -0
- data/sig/openai/models/beta/chatkit/thread_retrieve_params.rbs +19 -0
- data/sig/openai/models/beta/chatkit_upload_file_params.rbs +26 -0
- data/sig/openai/models/beta/chatkit_upload_file_response.rbs +14 -0
- data/sig/openai/models/beta/chatkit_workflow.rbs +55 -0
- data/sig/openai/models/beta/file_part.rbs +42 -0
- data/sig/openai/models/beta/image_part.rbs +47 -0
- data/sig/openai/models/image_model.rbs +3 -1
- data/sig/openai/models/realtime/realtime_session.rbs +8 -0
- data/sig/openai/models/realtime/realtime_session_create_request.rbs +8 -0
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +8 -0
- data/sig/openai/models/responses/tool.rbs +2 -1
- data/sig/openai/models/responses_model.rbs +4 -0
- data/sig/openai/models/video.rbs +88 -0
- data/sig/openai/models/video_create_error.rbs +15 -0
- data/sig/openai/models/video_create_params.rbs +58 -0
- data/sig/openai/models/video_delete_params.rbs +14 -0
- data/sig/openai/models/video_delete_response.rbs +22 -0
- data/sig/openai/models/video_download_content_params.rbs +40 -0
- data/sig/openai/models/video_list_params.rbs +55 -0
- data/sig/openai/models/video_model.rbs +14 -0
- data/sig/openai/models/video_remix_params.rbs +23 -0
- data/sig/openai/models/video_retrieve_params.rbs +15 -0
- data/sig/openai/models/video_seconds.rbs +15 -0
- data/sig/openai/models/video_size.rbs +16 -0
- data/sig/openai/models.rbs +22 -0
- data/sig/openai/resources/beta/chatkit/sessions.rbs +25 -0
- data/sig/openai/resources/beta/chatkit/threads.rbs +39 -0
- data/sig/openai/resources/beta/chatkit.rbs +18 -0
- data/sig/openai/resources/beta.rbs +2 -0
- data/sig/openai/resources/videos.rbs +45 -0
- metadata +140 -2
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatKitAttachment < OpenAI::Internal::Type::BaseModel
|
8
|
+
# @!attribute id
|
9
|
+
# Identifier for the attachment.
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
required :id, String
|
13
|
+
|
14
|
+
# @!attribute mime_type
|
15
|
+
# MIME type of the attachment.
|
16
|
+
#
|
17
|
+
# @return [String]
|
18
|
+
required :mime_type, String
|
19
|
+
|
20
|
+
# @!attribute name
|
21
|
+
# Original display name for the attachment.
|
22
|
+
#
|
23
|
+
# @return [String]
|
24
|
+
required :name, String
|
25
|
+
|
26
|
+
# @!attribute preview_url
|
27
|
+
# Preview URL for rendering the attachment inline.
|
28
|
+
#
|
29
|
+
# @return [String, nil]
|
30
|
+
required :preview_url, String, nil?: true
|
31
|
+
|
32
|
+
# @!attribute type
|
33
|
+
# Attachment discriminator.
|
34
|
+
#
|
35
|
+
# @return [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitAttachment::Type]
|
36
|
+
required :type, enum: -> { OpenAI::Beta::ChatKit::ChatKitAttachment::Type }
|
37
|
+
|
38
|
+
# @!method initialize(id:, mime_type:, name:, preview_url:, type:)
|
39
|
+
# Attachment metadata included on thread items.
|
40
|
+
#
|
41
|
+
# @param id [String] Identifier for the attachment.
|
42
|
+
#
|
43
|
+
# @param mime_type [String] MIME type of the attachment.
|
44
|
+
#
|
45
|
+
# @param name [String] Original display name for the attachment.
|
46
|
+
#
|
47
|
+
# @param preview_url [String, nil] Preview URL for rendering the attachment inline.
|
48
|
+
#
|
49
|
+
# @param type [Symbol, OpenAI::Models::Beta::ChatKit::ChatKitAttachment::Type] Attachment discriminator.
|
50
|
+
|
51
|
+
# Attachment discriminator.
|
52
|
+
#
|
53
|
+
# @see OpenAI::Models::Beta::ChatKit::ChatKitAttachment#type
|
54
|
+
module Type
|
55
|
+
extend OpenAI::Internal::Type::Enum
|
56
|
+
|
57
|
+
IMAGE = :image
|
58
|
+
FILE = :file
|
59
|
+
|
60
|
+
# @!method self.values
|
61
|
+
# @return [Array<Symbol>]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
ChatKitAttachment = ChatKit::ChatKitAttachment
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatKitResponseOutputText < OpenAI::Internal::Type::BaseModel
|
8
|
+
# @!attribute annotations
|
9
|
+
# Ordered list of annotations attached to the response text.
|
10
|
+
#
|
11
|
+
# @return [Array<OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File, OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL>]
|
12
|
+
required :annotations,
|
13
|
+
-> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation] }
|
14
|
+
|
15
|
+
# @!attribute text
|
16
|
+
# Assistant generated text.
|
17
|
+
#
|
18
|
+
# @return [String]
|
19
|
+
required :text, String
|
20
|
+
|
21
|
+
# @!attribute type
|
22
|
+
# Type discriminator that is always `output_text`.
|
23
|
+
#
|
24
|
+
# @return [Symbol, :output_text]
|
25
|
+
required :type, const: :output_text
|
26
|
+
|
27
|
+
# @!method initialize(annotations:, text:, type: :output_text)
|
28
|
+
# Assistant response text accompanied by optional annotations.
|
29
|
+
#
|
30
|
+
# @param annotations [Array<OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File, OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL>] Ordered list of annotations attached to the response text.
|
31
|
+
#
|
32
|
+
# @param text [String] Assistant generated text.
|
33
|
+
#
|
34
|
+
# @param type [Symbol, :output_text] Type discriminator that is always `output_text`.
|
35
|
+
|
36
|
+
# Annotation object describing a cited source.
|
37
|
+
module Annotation
|
38
|
+
extend OpenAI::Internal::Type::Union
|
39
|
+
|
40
|
+
discriminator :type
|
41
|
+
|
42
|
+
# Annotation that references an uploaded file.
|
43
|
+
variant :file, -> { OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File }
|
44
|
+
|
45
|
+
# Annotation that references a URL.
|
46
|
+
variant :url, -> { OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL }
|
47
|
+
|
48
|
+
class File < OpenAI::Internal::Type::BaseModel
|
49
|
+
# @!attribute source
|
50
|
+
# File attachment referenced by the annotation.
|
51
|
+
#
|
52
|
+
# @return [OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source]
|
53
|
+
required :source, -> { OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source }
|
54
|
+
|
55
|
+
# @!attribute type
|
56
|
+
# Type discriminator that is always `file` for this annotation.
|
57
|
+
#
|
58
|
+
# @return [Symbol, :file]
|
59
|
+
required :type, const: :file
|
60
|
+
|
61
|
+
# @!method initialize(source:, type: :file)
|
62
|
+
# Annotation that references an uploaded file.
|
63
|
+
#
|
64
|
+
# @param source [OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source] File attachment referenced by the annotation.
|
65
|
+
#
|
66
|
+
# @param type [Symbol, :file] Type discriminator that is always `file` for this annotation.
|
67
|
+
|
68
|
+
# @see OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File#source
|
69
|
+
class Source < OpenAI::Internal::Type::BaseModel
|
70
|
+
# @!attribute filename
|
71
|
+
# Filename referenced by the annotation.
|
72
|
+
#
|
73
|
+
# @return [String]
|
74
|
+
required :filename, String
|
75
|
+
|
76
|
+
# @!attribute type
|
77
|
+
# Type discriminator that is always `file`.
|
78
|
+
#
|
79
|
+
# @return [Symbol, :file]
|
80
|
+
required :type, const: :file
|
81
|
+
|
82
|
+
# @!method initialize(filename:, type: :file)
|
83
|
+
# File attachment referenced by the annotation.
|
84
|
+
#
|
85
|
+
# @param filename [String] Filename referenced by the annotation.
|
86
|
+
#
|
87
|
+
# @param type [Symbol, :file] Type discriminator that is always `file`.
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
class URL < OpenAI::Internal::Type::BaseModel
|
92
|
+
# @!attribute source
|
93
|
+
# URL referenced by the annotation.
|
94
|
+
#
|
95
|
+
# @return [OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source]
|
96
|
+
required :source, -> { OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source }
|
97
|
+
|
98
|
+
# @!attribute type
|
99
|
+
# Type discriminator that is always `url` for this annotation.
|
100
|
+
#
|
101
|
+
# @return [Symbol, :url]
|
102
|
+
required :type, const: :url
|
103
|
+
|
104
|
+
# @!method initialize(source:, type: :url)
|
105
|
+
# Annotation that references a URL.
|
106
|
+
#
|
107
|
+
# @param source [OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source] URL referenced by the annotation.
|
108
|
+
#
|
109
|
+
# @param type [Symbol, :url] Type discriminator that is always `url` for this annotation.
|
110
|
+
|
111
|
+
# @see OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL#source
|
112
|
+
class Source < OpenAI::Internal::Type::BaseModel
|
113
|
+
# @!attribute type
|
114
|
+
# Type discriminator that is always `url`.
|
115
|
+
#
|
116
|
+
# @return [Symbol, :url]
|
117
|
+
required :type, const: :url
|
118
|
+
|
119
|
+
# @!attribute url
|
120
|
+
# URL referenced by the annotation.
|
121
|
+
#
|
122
|
+
# @return [String]
|
123
|
+
required :url, String
|
124
|
+
|
125
|
+
# @!method initialize(url:, type: :url)
|
126
|
+
# URL referenced by the annotation.
|
127
|
+
#
|
128
|
+
# @param url [String] URL referenced by the annotation.
|
129
|
+
#
|
130
|
+
# @param type [Symbol, :url] Type discriminator that is always `url`.
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# @!method self.variants
|
135
|
+
# @return [Array(OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File, OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL)]
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
ChatKitResponseOutputText = ChatKit::ChatKitResponseOutputText
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
# @see OpenAI::Resources::Beta::ChatKit::Threads#retrieve
|
8
|
+
class ChatKitThread < OpenAI::Internal::Type::BaseModel
|
9
|
+
# @!attribute id
|
10
|
+
# Identifier of the thread.
|
11
|
+
#
|
12
|
+
# @return [String]
|
13
|
+
required :id, String
|
14
|
+
|
15
|
+
# @!attribute created_at
|
16
|
+
# Unix timestamp (in seconds) for when the thread was created.
|
17
|
+
#
|
18
|
+
# @return [Integer]
|
19
|
+
required :created_at, Integer
|
20
|
+
|
21
|
+
# @!attribute object
|
22
|
+
# Type discriminator that is always `chatkit.thread`.
|
23
|
+
#
|
24
|
+
# @return [Symbol, :"chatkit.thread"]
|
25
|
+
required :object, const: :"chatkit.thread"
|
26
|
+
|
27
|
+
# @!attribute status
|
28
|
+
# Current status for the thread. Defaults to `active` for newly created threads.
|
29
|
+
#
|
30
|
+
# @return [OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Active, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Locked, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Closed]
|
31
|
+
required :status, union: -> { OpenAI::Beta::ChatKit::ChatKitThread::Status }
|
32
|
+
|
33
|
+
# @!attribute title
|
34
|
+
# Optional human-readable title for the thread. Defaults to null when no title has
|
35
|
+
# been generated.
|
36
|
+
#
|
37
|
+
# @return [String, nil]
|
38
|
+
required :title, String, nil?: true
|
39
|
+
|
40
|
+
# @!attribute user
|
41
|
+
# Free-form string that identifies your end user who owns the thread.
|
42
|
+
#
|
43
|
+
# @return [String]
|
44
|
+
required :user, String
|
45
|
+
|
46
|
+
# @!method initialize(id:, created_at:, status:, title:, user:, object: :"chatkit.thread")
|
47
|
+
# Some parameter documentations has been truncated, see
|
48
|
+
# {OpenAI::Models::Beta::ChatKit::ChatKitThread} for more details.
|
49
|
+
#
|
50
|
+
# Represents a ChatKit thread and its current status.
|
51
|
+
#
|
52
|
+
# @param id [String] Identifier of the thread.
|
53
|
+
#
|
54
|
+
# @param created_at [Integer] Unix timestamp (in seconds) for when the thread was created.
|
55
|
+
#
|
56
|
+
# @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.
|
57
|
+
#
|
58
|
+
# @param title [String, nil] Optional human-readable title for the thread. Defaults to null when no title has
|
59
|
+
#
|
60
|
+
# @param user [String] Free-form string that identifies your end user who owns the thread.
|
61
|
+
#
|
62
|
+
# @param object [Symbol, :"chatkit.thread"] Type discriminator that is always `chatkit.thread`.
|
63
|
+
|
64
|
+
# Current status for the thread. Defaults to `active` for newly created threads.
|
65
|
+
#
|
66
|
+
# @see OpenAI::Models::Beta::ChatKit::ChatKitThread#status
|
67
|
+
module Status
|
68
|
+
extend OpenAI::Internal::Type::Union
|
69
|
+
|
70
|
+
discriminator :type
|
71
|
+
|
72
|
+
# Indicates that a thread is active.
|
73
|
+
variant :active, -> { OpenAI::Beta::ChatKit::ChatKitThread::Status::Active }
|
74
|
+
|
75
|
+
# Indicates that a thread is locked and cannot accept new input.
|
76
|
+
variant :locked, -> { OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked }
|
77
|
+
|
78
|
+
# Indicates that a thread has been closed.
|
79
|
+
variant :closed, -> { OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed }
|
80
|
+
|
81
|
+
class Active < OpenAI::Internal::Type::BaseModel
|
82
|
+
# @!attribute type
|
83
|
+
# Status discriminator that is always `active`.
|
84
|
+
#
|
85
|
+
# @return [Symbol, :active]
|
86
|
+
required :type, const: :active
|
87
|
+
|
88
|
+
# @!method initialize(type: :active)
|
89
|
+
# Indicates that a thread is active.
|
90
|
+
#
|
91
|
+
# @param type [Symbol, :active] Status discriminator that is always `active`.
|
92
|
+
end
|
93
|
+
|
94
|
+
class Locked < OpenAI::Internal::Type::BaseModel
|
95
|
+
# @!attribute reason
|
96
|
+
# Reason that the thread was locked. Defaults to null when no reason is recorded.
|
97
|
+
#
|
98
|
+
# @return [String, nil]
|
99
|
+
required :reason, String, nil?: true
|
100
|
+
|
101
|
+
# @!attribute type
|
102
|
+
# Status discriminator that is always `locked`.
|
103
|
+
#
|
104
|
+
# @return [Symbol, :locked]
|
105
|
+
required :type, const: :locked
|
106
|
+
|
107
|
+
# @!method initialize(reason:, type: :locked)
|
108
|
+
# Indicates that a thread is locked and cannot accept new input.
|
109
|
+
#
|
110
|
+
# @param reason [String, nil] Reason that the thread was locked. Defaults to null when no reason is recorded.
|
111
|
+
#
|
112
|
+
# @param type [Symbol, :locked] Status discriminator that is always `locked`.
|
113
|
+
end
|
114
|
+
|
115
|
+
class Closed < OpenAI::Internal::Type::BaseModel
|
116
|
+
# @!attribute reason
|
117
|
+
# Reason that the thread was closed. Defaults to null when no reason is recorded.
|
118
|
+
#
|
119
|
+
# @return [String, nil]
|
120
|
+
required :reason, String, nil?: true
|
121
|
+
|
122
|
+
# @!attribute type
|
123
|
+
# Status discriminator that is always `closed`.
|
124
|
+
#
|
125
|
+
# @return [Symbol, :closed]
|
126
|
+
required :type, const: :closed
|
127
|
+
|
128
|
+
# @!method initialize(reason:, type: :closed)
|
129
|
+
# Indicates that a thread has been closed.
|
130
|
+
#
|
131
|
+
# @param reason [String, nil] Reason that the thread was closed. Defaults to null when no reason is recorded.
|
132
|
+
#
|
133
|
+
# @param type [Symbol, :closed] Status discriminator that is always `closed`.
|
134
|
+
end
|
135
|
+
|
136
|
+
# @!method self.variants
|
137
|
+
# @return [Array(OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Active, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Locked, OpenAI::Models::Beta::ChatKit::ChatKitThread::Status::Closed)]
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
ChatKitThread = ChatKit::ChatKitThread
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatKitThreadAssistantMessageItem < OpenAI::Internal::Type::BaseModel
|
8
|
+
# @!attribute id
|
9
|
+
# Identifier of the thread item.
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
required :id, String
|
13
|
+
|
14
|
+
# @!attribute content
|
15
|
+
# Ordered assistant response segments.
|
16
|
+
#
|
17
|
+
# @return [Array<OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText>]
|
18
|
+
required :content,
|
19
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ChatKit::ChatKitResponseOutputText] }
|
20
|
+
|
21
|
+
# @!attribute created_at
|
22
|
+
# Unix timestamp (in seconds) for when the item was created.
|
23
|
+
#
|
24
|
+
# @return [Integer]
|
25
|
+
required :created_at, Integer
|
26
|
+
|
27
|
+
# @!attribute object
|
28
|
+
# Type discriminator that is always `chatkit.thread_item`.
|
29
|
+
#
|
30
|
+
# @return [Symbol, :"chatkit.thread_item"]
|
31
|
+
required :object, const: :"chatkit.thread_item"
|
32
|
+
|
33
|
+
# @!attribute thread_id
|
34
|
+
# Identifier of the parent thread.
|
35
|
+
#
|
36
|
+
# @return [String]
|
37
|
+
required :thread_id, String
|
38
|
+
|
39
|
+
# @!attribute type
|
40
|
+
# Type discriminator that is always `chatkit.assistant_message`.
|
41
|
+
#
|
42
|
+
# @return [Symbol, :"chatkit.assistant_message"]
|
43
|
+
required :type, const: :"chatkit.assistant_message"
|
44
|
+
|
45
|
+
# @!method initialize(id:, content:, created_at:, thread_id:, object: :"chatkit.thread_item", type: :"chatkit.assistant_message")
|
46
|
+
# Assistant-authored message within a thread.
|
47
|
+
#
|
48
|
+
# @param id [String] Identifier of the thread item.
|
49
|
+
#
|
50
|
+
# @param content [Array<OpenAI::Models::Beta::ChatKit::ChatKitResponseOutputText>] Ordered assistant response segments.
|
51
|
+
#
|
52
|
+
# @param created_at [Integer] Unix timestamp (in seconds) for when the item was created.
|
53
|
+
#
|
54
|
+
# @param thread_id [String] Identifier of the parent thread.
|
55
|
+
#
|
56
|
+
# @param object [Symbol, :"chatkit.thread_item"] Type discriminator that is always `chatkit.thread_item`.
|
57
|
+
#
|
58
|
+
# @param type [Symbol, :"chatkit.assistant_message"] Type discriminator that is always `chatkit.assistant_message`.
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
ChatKitThreadAssistantMessageItem = ChatKit::ChatKitThreadAssistantMessageItem
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|