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,116 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
ChatKitAttachment = ChatKit::ChatKitAttachment
|
7
|
+
|
8
|
+
module ChatKit
|
9
|
+
class ChatKitAttachment < OpenAI::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
OpenAI::Beta::ChatKit::ChatKitAttachment,
|
14
|
+
OpenAI::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Identifier for the attachment.
|
19
|
+
sig { returns(String) }
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# MIME type of the attachment.
|
23
|
+
sig { returns(String) }
|
24
|
+
attr_accessor :mime_type
|
25
|
+
|
26
|
+
# Original display name for the attachment.
|
27
|
+
sig { returns(String) }
|
28
|
+
attr_accessor :name
|
29
|
+
|
30
|
+
# Preview URL for rendering the attachment inline.
|
31
|
+
sig { returns(T.nilable(String)) }
|
32
|
+
attr_accessor :preview_url
|
33
|
+
|
34
|
+
# Attachment discriminator.
|
35
|
+
sig do
|
36
|
+
returns(
|
37
|
+
OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol
|
38
|
+
)
|
39
|
+
end
|
40
|
+
attr_accessor :type
|
41
|
+
|
42
|
+
# Attachment metadata included on thread items.
|
43
|
+
sig do
|
44
|
+
params(
|
45
|
+
id: String,
|
46
|
+
mime_type: String,
|
47
|
+
name: String,
|
48
|
+
preview_url: T.nilable(String),
|
49
|
+
type: OpenAI::Beta::ChatKit::ChatKitAttachment::Type::OrSymbol
|
50
|
+
).returns(T.attached_class)
|
51
|
+
end
|
52
|
+
def self.new(
|
53
|
+
# Identifier for the attachment.
|
54
|
+
id:,
|
55
|
+
# MIME type of the attachment.
|
56
|
+
mime_type:,
|
57
|
+
# Original display name for the attachment.
|
58
|
+
name:,
|
59
|
+
# Preview URL for rendering the attachment inline.
|
60
|
+
preview_url:,
|
61
|
+
# Attachment discriminator.
|
62
|
+
type:
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
sig do
|
67
|
+
override.returns(
|
68
|
+
{
|
69
|
+
id: String,
|
70
|
+
mime_type: String,
|
71
|
+
name: String,
|
72
|
+
preview_url: T.nilable(String),
|
73
|
+
type:
|
74
|
+
OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol
|
75
|
+
}
|
76
|
+
)
|
77
|
+
end
|
78
|
+
def to_hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# Attachment discriminator.
|
82
|
+
module Type
|
83
|
+
extend OpenAI::Internal::Type::Enum
|
84
|
+
|
85
|
+
TaggedSymbol =
|
86
|
+
T.type_alias do
|
87
|
+
T.all(Symbol, OpenAI::Beta::ChatKit::ChatKitAttachment::Type)
|
88
|
+
end
|
89
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
90
|
+
|
91
|
+
IMAGE =
|
92
|
+
T.let(
|
93
|
+
:image,
|
94
|
+
OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol
|
95
|
+
)
|
96
|
+
FILE =
|
97
|
+
T.let(
|
98
|
+
:file,
|
99
|
+
OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol
|
100
|
+
)
|
101
|
+
|
102
|
+
sig do
|
103
|
+
override.returns(
|
104
|
+
T::Array[
|
105
|
+
OpenAI::Beta::ChatKit::ChatKitAttachment::Type::TaggedSymbol
|
106
|
+
]
|
107
|
+
)
|
108
|
+
end
|
109
|
+
def self.values
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1,287 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
ChatKitResponseOutputText = ChatKit::ChatKitResponseOutputText
|
7
|
+
|
8
|
+
module ChatKit
|
9
|
+
class ChatKitResponseOutputText < OpenAI::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText,
|
14
|
+
OpenAI::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Ordered list of annotations attached to the response text.
|
19
|
+
sig do
|
20
|
+
returns(
|
21
|
+
T::Array[
|
22
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::Variants
|
23
|
+
]
|
24
|
+
)
|
25
|
+
end
|
26
|
+
attr_accessor :annotations
|
27
|
+
|
28
|
+
# Assistant generated text.
|
29
|
+
sig { returns(String) }
|
30
|
+
attr_accessor :text
|
31
|
+
|
32
|
+
# Type discriminator that is always `output_text`.
|
33
|
+
sig { returns(Symbol) }
|
34
|
+
attr_accessor :type
|
35
|
+
|
36
|
+
# Assistant response text accompanied by optional annotations.
|
37
|
+
sig do
|
38
|
+
params(
|
39
|
+
annotations:
|
40
|
+
T::Array[
|
41
|
+
T.any(
|
42
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::OrHash,
|
43
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::OrHash
|
44
|
+
)
|
45
|
+
],
|
46
|
+
text: String,
|
47
|
+
type: Symbol
|
48
|
+
).returns(T.attached_class)
|
49
|
+
end
|
50
|
+
def self.new(
|
51
|
+
# Ordered list of annotations attached to the response text.
|
52
|
+
annotations:,
|
53
|
+
# Assistant generated text.
|
54
|
+
text:,
|
55
|
+
# Type discriminator that is always `output_text`.
|
56
|
+
type: :output_text
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
sig do
|
61
|
+
override.returns(
|
62
|
+
{
|
63
|
+
annotations:
|
64
|
+
T::Array[
|
65
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::Variants
|
66
|
+
],
|
67
|
+
text: String,
|
68
|
+
type: Symbol
|
69
|
+
}
|
70
|
+
)
|
71
|
+
end
|
72
|
+
def to_hash
|
73
|
+
end
|
74
|
+
|
75
|
+
# Annotation object describing a cited source.
|
76
|
+
module Annotation
|
77
|
+
extend OpenAI::Internal::Type::Union
|
78
|
+
|
79
|
+
Variants =
|
80
|
+
T.type_alias do
|
81
|
+
T.any(
|
82
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File,
|
83
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
class File < OpenAI::Internal::Type::BaseModel
|
88
|
+
OrHash =
|
89
|
+
T.type_alias do
|
90
|
+
T.any(
|
91
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File,
|
92
|
+
OpenAI::Internal::AnyHash
|
93
|
+
)
|
94
|
+
end
|
95
|
+
|
96
|
+
# File attachment referenced by the annotation.
|
97
|
+
sig do
|
98
|
+
returns(
|
99
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source
|
100
|
+
)
|
101
|
+
end
|
102
|
+
attr_reader :source
|
103
|
+
|
104
|
+
sig do
|
105
|
+
params(
|
106
|
+
source:
|
107
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source::OrHash
|
108
|
+
).void
|
109
|
+
end
|
110
|
+
attr_writer :source
|
111
|
+
|
112
|
+
# Type discriminator that is always `file` for this annotation.
|
113
|
+
sig { returns(Symbol) }
|
114
|
+
attr_accessor :type
|
115
|
+
|
116
|
+
# Annotation that references an uploaded file.
|
117
|
+
sig do
|
118
|
+
params(
|
119
|
+
source:
|
120
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source::OrHash,
|
121
|
+
type: Symbol
|
122
|
+
).returns(T.attached_class)
|
123
|
+
end
|
124
|
+
def self.new(
|
125
|
+
# File attachment referenced by the annotation.
|
126
|
+
source:,
|
127
|
+
# Type discriminator that is always `file` for this annotation.
|
128
|
+
type: :file
|
129
|
+
)
|
130
|
+
end
|
131
|
+
|
132
|
+
sig do
|
133
|
+
override.returns(
|
134
|
+
{
|
135
|
+
source:
|
136
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source,
|
137
|
+
type: Symbol
|
138
|
+
}
|
139
|
+
)
|
140
|
+
end
|
141
|
+
def to_hash
|
142
|
+
end
|
143
|
+
|
144
|
+
class Source < OpenAI::Internal::Type::BaseModel
|
145
|
+
OrHash =
|
146
|
+
T.type_alias do
|
147
|
+
T.any(
|
148
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::File::Source,
|
149
|
+
OpenAI::Internal::AnyHash
|
150
|
+
)
|
151
|
+
end
|
152
|
+
|
153
|
+
# Filename referenced by the annotation.
|
154
|
+
sig { returns(String) }
|
155
|
+
attr_accessor :filename
|
156
|
+
|
157
|
+
# Type discriminator that is always `file`.
|
158
|
+
sig { returns(Symbol) }
|
159
|
+
attr_accessor :type
|
160
|
+
|
161
|
+
# File attachment referenced by the annotation.
|
162
|
+
sig do
|
163
|
+
params(filename: String, type: Symbol).returns(
|
164
|
+
T.attached_class
|
165
|
+
)
|
166
|
+
end
|
167
|
+
def self.new(
|
168
|
+
# Filename referenced by the annotation.
|
169
|
+
filename:,
|
170
|
+
# Type discriminator that is always `file`.
|
171
|
+
type: :file
|
172
|
+
)
|
173
|
+
end
|
174
|
+
|
175
|
+
sig { override.returns({ filename: String, type: Symbol }) }
|
176
|
+
def to_hash
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
class URL < OpenAI::Internal::Type::BaseModel
|
182
|
+
OrHash =
|
183
|
+
T.type_alias do
|
184
|
+
T.any(
|
185
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL,
|
186
|
+
OpenAI::Internal::AnyHash
|
187
|
+
)
|
188
|
+
end
|
189
|
+
|
190
|
+
# URL referenced by the annotation.
|
191
|
+
sig do
|
192
|
+
returns(
|
193
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source
|
194
|
+
)
|
195
|
+
end
|
196
|
+
attr_reader :source
|
197
|
+
|
198
|
+
sig do
|
199
|
+
params(
|
200
|
+
source:
|
201
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source::OrHash
|
202
|
+
).void
|
203
|
+
end
|
204
|
+
attr_writer :source
|
205
|
+
|
206
|
+
# Type discriminator that is always `url` for this annotation.
|
207
|
+
sig { returns(Symbol) }
|
208
|
+
attr_accessor :type
|
209
|
+
|
210
|
+
# Annotation that references a URL.
|
211
|
+
sig do
|
212
|
+
params(
|
213
|
+
source:
|
214
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source::OrHash,
|
215
|
+
type: Symbol
|
216
|
+
).returns(T.attached_class)
|
217
|
+
end
|
218
|
+
def self.new(
|
219
|
+
# URL referenced by the annotation.
|
220
|
+
source:,
|
221
|
+
# Type discriminator that is always `url` for this annotation.
|
222
|
+
type: :url
|
223
|
+
)
|
224
|
+
end
|
225
|
+
|
226
|
+
sig do
|
227
|
+
override.returns(
|
228
|
+
{
|
229
|
+
source:
|
230
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source,
|
231
|
+
type: Symbol
|
232
|
+
}
|
233
|
+
)
|
234
|
+
end
|
235
|
+
def to_hash
|
236
|
+
end
|
237
|
+
|
238
|
+
class Source < OpenAI::Internal::Type::BaseModel
|
239
|
+
OrHash =
|
240
|
+
T.type_alias do
|
241
|
+
T.any(
|
242
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::URL::Source,
|
243
|
+
OpenAI::Internal::AnyHash
|
244
|
+
)
|
245
|
+
end
|
246
|
+
|
247
|
+
# Type discriminator that is always `url`.
|
248
|
+
sig { returns(Symbol) }
|
249
|
+
attr_accessor :type
|
250
|
+
|
251
|
+
# URL referenced by the annotation.
|
252
|
+
sig { returns(String) }
|
253
|
+
attr_accessor :url
|
254
|
+
|
255
|
+
# URL referenced by the annotation.
|
256
|
+
sig do
|
257
|
+
params(url: String, type: Symbol).returns(T.attached_class)
|
258
|
+
end
|
259
|
+
def self.new(
|
260
|
+
# URL referenced by the annotation.
|
261
|
+
url:,
|
262
|
+
# Type discriminator that is always `url`.
|
263
|
+
type: :url
|
264
|
+
)
|
265
|
+
end
|
266
|
+
|
267
|
+
sig { override.returns({ type: Symbol, url: String }) }
|
268
|
+
def to_hash
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
sig do
|
274
|
+
override.returns(
|
275
|
+
T::Array[
|
276
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::Annotation::Variants
|
277
|
+
]
|
278
|
+
)
|
279
|
+
end
|
280
|
+
def self.variants
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
@@ -0,0 +1,220 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
ChatKitThread = ChatKit::ChatKitThread
|
7
|
+
|
8
|
+
module ChatKit
|
9
|
+
class ChatKitThread < OpenAI::Internal::Type::BaseModel
|
10
|
+
OrHash =
|
11
|
+
T.type_alias do
|
12
|
+
T.any(
|
13
|
+
OpenAI::Beta::ChatKit::ChatKitThread,
|
14
|
+
OpenAI::Internal::AnyHash
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Identifier of the thread.
|
19
|
+
sig { returns(String) }
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# Unix timestamp (in seconds) for when the thread was created.
|
23
|
+
sig { returns(Integer) }
|
24
|
+
attr_accessor :created_at
|
25
|
+
|
26
|
+
# Type discriminator that is always `chatkit.thread`.
|
27
|
+
sig { returns(Symbol) }
|
28
|
+
attr_accessor :object
|
29
|
+
|
30
|
+
# Current status for the thread. Defaults to `active` for newly created threads.
|
31
|
+
sig do
|
32
|
+
returns(OpenAI::Beta::ChatKit::ChatKitThread::Status::Variants)
|
33
|
+
end
|
34
|
+
attr_accessor :status
|
35
|
+
|
36
|
+
# Optional human-readable title for the thread. Defaults to null when no title has
|
37
|
+
# been generated.
|
38
|
+
sig { returns(T.nilable(String)) }
|
39
|
+
attr_accessor :title
|
40
|
+
|
41
|
+
# Free-form string that identifies your end user who owns the thread.
|
42
|
+
sig { returns(String) }
|
43
|
+
attr_accessor :user
|
44
|
+
|
45
|
+
# Represents a ChatKit thread and its current status.
|
46
|
+
sig do
|
47
|
+
params(
|
48
|
+
id: String,
|
49
|
+
created_at: Integer,
|
50
|
+
status:
|
51
|
+
T.any(
|
52
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Active::OrHash,
|
53
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked::OrHash,
|
54
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed::OrHash
|
55
|
+
),
|
56
|
+
title: T.nilable(String),
|
57
|
+
user: String,
|
58
|
+
object: Symbol
|
59
|
+
).returns(T.attached_class)
|
60
|
+
end
|
61
|
+
def self.new(
|
62
|
+
# Identifier of the thread.
|
63
|
+
id:,
|
64
|
+
# Unix timestamp (in seconds) for when the thread was created.
|
65
|
+
created_at:,
|
66
|
+
# Current status for the thread. Defaults to `active` for newly created threads.
|
67
|
+
status:,
|
68
|
+
# Optional human-readable title for the thread. Defaults to null when no title has
|
69
|
+
# been generated.
|
70
|
+
title:,
|
71
|
+
# Free-form string that identifies your end user who owns the thread.
|
72
|
+
user:,
|
73
|
+
# Type discriminator that is always `chatkit.thread`.
|
74
|
+
object: :"chatkit.thread"
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
78
|
+
sig do
|
79
|
+
override.returns(
|
80
|
+
{
|
81
|
+
id: String,
|
82
|
+
created_at: Integer,
|
83
|
+
object: Symbol,
|
84
|
+
status: OpenAI::Beta::ChatKit::ChatKitThread::Status::Variants,
|
85
|
+
title: T.nilable(String),
|
86
|
+
user: String
|
87
|
+
}
|
88
|
+
)
|
89
|
+
end
|
90
|
+
def to_hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Current status for the thread. Defaults to `active` for newly created threads.
|
94
|
+
module Status
|
95
|
+
extend OpenAI::Internal::Type::Union
|
96
|
+
|
97
|
+
Variants =
|
98
|
+
T.type_alias do
|
99
|
+
T.any(
|
100
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Active,
|
101
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked,
|
102
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
class Active < OpenAI::Internal::Type::BaseModel
|
107
|
+
OrHash =
|
108
|
+
T.type_alias do
|
109
|
+
T.any(
|
110
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Active,
|
111
|
+
OpenAI::Internal::AnyHash
|
112
|
+
)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Status discriminator that is always `active`.
|
116
|
+
sig { returns(Symbol) }
|
117
|
+
attr_accessor :type
|
118
|
+
|
119
|
+
# Indicates that a thread is active.
|
120
|
+
sig { params(type: Symbol).returns(T.attached_class) }
|
121
|
+
def self.new(
|
122
|
+
# Status discriminator that is always `active`.
|
123
|
+
type: :active
|
124
|
+
)
|
125
|
+
end
|
126
|
+
|
127
|
+
sig { override.returns({ type: Symbol }) }
|
128
|
+
def to_hash
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
class Locked < OpenAI::Internal::Type::BaseModel
|
133
|
+
OrHash =
|
134
|
+
T.type_alias do
|
135
|
+
T.any(
|
136
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Locked,
|
137
|
+
OpenAI::Internal::AnyHash
|
138
|
+
)
|
139
|
+
end
|
140
|
+
|
141
|
+
# Reason that the thread was locked. Defaults to null when no reason is recorded.
|
142
|
+
sig { returns(T.nilable(String)) }
|
143
|
+
attr_accessor :reason
|
144
|
+
|
145
|
+
# Status discriminator that is always `locked`.
|
146
|
+
sig { returns(Symbol) }
|
147
|
+
attr_accessor :type
|
148
|
+
|
149
|
+
# Indicates that a thread is locked and cannot accept new input.
|
150
|
+
sig do
|
151
|
+
params(reason: T.nilable(String), type: Symbol).returns(
|
152
|
+
T.attached_class
|
153
|
+
)
|
154
|
+
end
|
155
|
+
def self.new(
|
156
|
+
# Reason that the thread was locked. Defaults to null when no reason is recorded.
|
157
|
+
reason:,
|
158
|
+
# Status discriminator that is always `locked`.
|
159
|
+
type: :locked
|
160
|
+
)
|
161
|
+
end
|
162
|
+
|
163
|
+
sig do
|
164
|
+
override.returns({ reason: T.nilable(String), type: Symbol })
|
165
|
+
end
|
166
|
+
def to_hash
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
class Closed < OpenAI::Internal::Type::BaseModel
|
171
|
+
OrHash =
|
172
|
+
T.type_alias do
|
173
|
+
T.any(
|
174
|
+
OpenAI::Beta::ChatKit::ChatKitThread::Status::Closed,
|
175
|
+
OpenAI::Internal::AnyHash
|
176
|
+
)
|
177
|
+
end
|
178
|
+
|
179
|
+
# Reason that the thread was closed. Defaults to null when no reason is recorded.
|
180
|
+
sig { returns(T.nilable(String)) }
|
181
|
+
attr_accessor :reason
|
182
|
+
|
183
|
+
# Status discriminator that is always `closed`.
|
184
|
+
sig { returns(Symbol) }
|
185
|
+
attr_accessor :type
|
186
|
+
|
187
|
+
# Indicates that a thread has been closed.
|
188
|
+
sig do
|
189
|
+
params(reason: T.nilable(String), type: Symbol).returns(
|
190
|
+
T.attached_class
|
191
|
+
)
|
192
|
+
end
|
193
|
+
def self.new(
|
194
|
+
# Reason that the thread was closed. Defaults to null when no reason is recorded.
|
195
|
+
reason:,
|
196
|
+
# Status discriminator that is always `closed`.
|
197
|
+
type: :closed
|
198
|
+
)
|
199
|
+
end
|
200
|
+
|
201
|
+
sig do
|
202
|
+
override.returns({ reason: T.nilable(String), type: Symbol })
|
203
|
+
end
|
204
|
+
def to_hash
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
sig do
|
209
|
+
override.returns(
|
210
|
+
T::Array[OpenAI::Beta::ChatKit::ChatKitThread::Status::Variants]
|
211
|
+
)
|
212
|
+
end
|
213
|
+
def self.variants
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
ChatKitThreadAssistantMessageItem =
|
7
|
+
ChatKit::ChatKitThreadAssistantMessageItem
|
8
|
+
|
9
|
+
module ChatKit
|
10
|
+
class ChatKitThreadAssistantMessageItem < OpenAI::Internal::Type::BaseModel
|
11
|
+
OrHash =
|
12
|
+
T.type_alias do
|
13
|
+
T.any(
|
14
|
+
OpenAI::Beta::ChatKit::ChatKitThreadAssistantMessageItem,
|
15
|
+
OpenAI::Internal::AnyHash
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Identifier of the thread item.
|
20
|
+
sig { returns(String) }
|
21
|
+
attr_accessor :id
|
22
|
+
|
23
|
+
# Ordered assistant response segments.
|
24
|
+
sig do
|
25
|
+
returns(T::Array[OpenAI::Beta::ChatKit::ChatKitResponseOutputText])
|
26
|
+
end
|
27
|
+
attr_accessor :content
|
28
|
+
|
29
|
+
# Unix timestamp (in seconds) for when the item was created.
|
30
|
+
sig { returns(Integer) }
|
31
|
+
attr_accessor :created_at
|
32
|
+
|
33
|
+
# Type discriminator that is always `chatkit.thread_item`.
|
34
|
+
sig { returns(Symbol) }
|
35
|
+
attr_accessor :object
|
36
|
+
|
37
|
+
# Identifier of the parent thread.
|
38
|
+
sig { returns(String) }
|
39
|
+
attr_accessor :thread_id
|
40
|
+
|
41
|
+
# Type discriminator that is always `chatkit.assistant_message`.
|
42
|
+
sig { returns(Symbol) }
|
43
|
+
attr_accessor :type
|
44
|
+
|
45
|
+
# Assistant-authored message within a thread.
|
46
|
+
sig do
|
47
|
+
params(
|
48
|
+
id: String,
|
49
|
+
content:
|
50
|
+
T::Array[
|
51
|
+
OpenAI::Beta::ChatKit::ChatKitResponseOutputText::OrHash
|
52
|
+
],
|
53
|
+
created_at: Integer,
|
54
|
+
thread_id: String,
|
55
|
+
object: Symbol,
|
56
|
+
type: Symbol
|
57
|
+
).returns(T.attached_class)
|
58
|
+
end
|
59
|
+
def self.new(
|
60
|
+
# Identifier of the thread item.
|
61
|
+
id:,
|
62
|
+
# Ordered assistant response segments.
|
63
|
+
content:,
|
64
|
+
# Unix timestamp (in seconds) for when the item was created.
|
65
|
+
created_at:,
|
66
|
+
# Identifier of the parent thread.
|
67
|
+
thread_id:,
|
68
|
+
# Type discriminator that is always `chatkit.thread_item`.
|
69
|
+
object: :"chatkit.thread_item",
|
70
|
+
# Type discriminator that is always `chatkit.assistant_message`.
|
71
|
+
type: :"chatkit.assistant_message"
|
72
|
+
)
|
73
|
+
end
|
74
|
+
|
75
|
+
sig do
|
76
|
+
override.returns(
|
77
|
+
{
|
78
|
+
id: String,
|
79
|
+
content:
|
80
|
+
T::Array[OpenAI::Beta::ChatKit::ChatKitResponseOutputText],
|
81
|
+
created_at: Integer,
|
82
|
+
object: Symbol,
|
83
|
+
thread_id: String,
|
84
|
+
type: Symbol
|
85
|
+
}
|
86
|
+
)
|
87
|
+
end
|
88
|
+
def to_hash
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|