openai 0.28.1 → 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 +16 -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/call_accept_params.rb +16 -0
- data/lib/openai/models/realtime/call_hangup_params.rb +16 -0
- data/lib/openai/models/realtime/call_refer_params.rb +28 -0
- data/lib/openai/models/realtime/call_reject_params.rb +28 -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/realtime/calls.rb +143 -0
- data/lib/openai/resources/realtime.rb +4 -0
- data/lib/openai/resources/videos.rb +165 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +52 -1
- 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/call_accept_params.rbi +29 -0
- data/rbi/openai/models/realtime/call_hangup_params.rbi +29 -0
- data/rbi/openai/models/realtime/call_refer_params.rbi +44 -0
- data/rbi/openai/models/realtime/call_reject_params.rbi +47 -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/realtime/calls.rbi +182 -0
- data/rbi/openai/resources/realtime.rbi +3 -0
- 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/call_accept_params.rbs +17 -0
- data/sig/openai/models/realtime/call_hangup_params.rbs +17 -0
- data/sig/openai/models/realtime/call_refer_params.rbs +25 -0
- data/sig/openai/models/realtime/call_reject_params.rbs +27 -0
- 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/realtime/calls.rbs +43 -0
- data/sig/openai/resources/realtime.rbs +2 -0
- data/sig/openai/resources/videos.rbs +45 -0
- metadata +155 -2
@@ -0,0 +1,141 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatSession < OpenAI::Internal::Type::BaseModel
|
8
|
+
OrHash =
|
9
|
+
T.type_alias do
|
10
|
+
T.any(
|
11
|
+
OpenAI::Beta::ChatKit::ChatSession,
|
12
|
+
OpenAI::Internal::AnyHash
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Identifier for the ChatKit session.
|
17
|
+
sig { returns(String) }
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
# Resolved ChatKit feature configuration for the session.
|
21
|
+
sig do
|
22
|
+
returns(OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration)
|
23
|
+
end
|
24
|
+
attr_reader :chatkit_configuration
|
25
|
+
|
26
|
+
sig do
|
27
|
+
params(
|
28
|
+
chatkit_configuration:
|
29
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration::OrHash
|
30
|
+
).void
|
31
|
+
end
|
32
|
+
attr_writer :chatkit_configuration
|
33
|
+
|
34
|
+
# Ephemeral client secret that authenticates session requests.
|
35
|
+
sig { returns(String) }
|
36
|
+
attr_accessor :client_secret
|
37
|
+
|
38
|
+
# Unix timestamp (in seconds) for when the session expires.
|
39
|
+
sig { returns(Integer) }
|
40
|
+
attr_accessor :expires_at
|
41
|
+
|
42
|
+
# Convenience copy of the per-minute request limit.
|
43
|
+
sig { returns(Integer) }
|
44
|
+
attr_accessor :max_requests_per_1_minute
|
45
|
+
|
46
|
+
# Type discriminator that is always `chatkit.session`.
|
47
|
+
sig { returns(Symbol) }
|
48
|
+
attr_accessor :object
|
49
|
+
|
50
|
+
# Resolved rate limit values.
|
51
|
+
sig { returns(OpenAI::Beta::ChatKit::ChatSessionRateLimits) }
|
52
|
+
attr_reader :rate_limits
|
53
|
+
|
54
|
+
sig do
|
55
|
+
params(
|
56
|
+
rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits::OrHash
|
57
|
+
).void
|
58
|
+
end
|
59
|
+
attr_writer :rate_limits
|
60
|
+
|
61
|
+
# Current lifecycle state of the session.
|
62
|
+
sig do
|
63
|
+
returns(OpenAI::Beta::ChatKit::ChatSessionStatus::TaggedSymbol)
|
64
|
+
end
|
65
|
+
attr_accessor :status
|
66
|
+
|
67
|
+
# User identifier associated with the session.
|
68
|
+
sig { returns(String) }
|
69
|
+
attr_accessor :user
|
70
|
+
|
71
|
+
# Workflow metadata for the session.
|
72
|
+
sig { returns(OpenAI::Beta::ChatKitWorkflow) }
|
73
|
+
attr_reader :workflow
|
74
|
+
|
75
|
+
sig { params(workflow: OpenAI::Beta::ChatKitWorkflow::OrHash).void }
|
76
|
+
attr_writer :workflow
|
77
|
+
|
78
|
+
# Represents a ChatKit session and its resolved configuration.
|
79
|
+
sig do
|
80
|
+
params(
|
81
|
+
id: String,
|
82
|
+
chatkit_configuration:
|
83
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration::OrHash,
|
84
|
+
client_secret: String,
|
85
|
+
expires_at: Integer,
|
86
|
+
max_requests_per_1_minute: Integer,
|
87
|
+
rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits::OrHash,
|
88
|
+
status: OpenAI::Beta::ChatKit::ChatSessionStatus::OrSymbol,
|
89
|
+
user: String,
|
90
|
+
workflow: OpenAI::Beta::ChatKitWorkflow::OrHash,
|
91
|
+
object: Symbol
|
92
|
+
).returns(T.attached_class)
|
93
|
+
end
|
94
|
+
def self.new(
|
95
|
+
# Identifier for the ChatKit session.
|
96
|
+
id:,
|
97
|
+
# Resolved ChatKit feature configuration for the session.
|
98
|
+
chatkit_configuration:,
|
99
|
+
# Ephemeral client secret that authenticates session requests.
|
100
|
+
client_secret:,
|
101
|
+
# Unix timestamp (in seconds) for when the session expires.
|
102
|
+
expires_at:,
|
103
|
+
# Convenience copy of the per-minute request limit.
|
104
|
+
max_requests_per_1_minute:,
|
105
|
+
# Resolved rate limit values.
|
106
|
+
rate_limits:,
|
107
|
+
# Current lifecycle state of the session.
|
108
|
+
status:,
|
109
|
+
# User identifier associated with the session.
|
110
|
+
user:,
|
111
|
+
# Workflow metadata for the session.
|
112
|
+
workflow:,
|
113
|
+
# Type discriminator that is always `chatkit.session`.
|
114
|
+
object: :"chatkit.session"
|
115
|
+
)
|
116
|
+
end
|
117
|
+
|
118
|
+
sig do
|
119
|
+
override.returns(
|
120
|
+
{
|
121
|
+
id: String,
|
122
|
+
chatkit_configuration:
|
123
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration,
|
124
|
+
client_secret: String,
|
125
|
+
expires_at: Integer,
|
126
|
+
max_requests_per_1_minute: Integer,
|
127
|
+
object: Symbol,
|
128
|
+
rate_limits: OpenAI::Beta::ChatKit::ChatSessionRateLimits,
|
129
|
+
status: OpenAI::Beta::ChatKit::ChatSessionStatus::TaggedSymbol,
|
130
|
+
user: String,
|
131
|
+
workflow: OpenAI::Beta::ChatKitWorkflow
|
132
|
+
}
|
133
|
+
)
|
134
|
+
end
|
135
|
+
def to_hash
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatSessionAutomaticThreadTitling < OpenAI::Internal::Type::BaseModel
|
8
|
+
OrHash =
|
9
|
+
T.type_alias do
|
10
|
+
T.any(
|
11
|
+
OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling,
|
12
|
+
OpenAI::Internal::AnyHash
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Whether automatic thread titling is enabled.
|
17
|
+
sig { returns(T::Boolean) }
|
18
|
+
attr_accessor :enabled
|
19
|
+
|
20
|
+
# Automatic thread title preferences for the session.
|
21
|
+
sig { params(enabled: T::Boolean).returns(T.attached_class) }
|
22
|
+
def self.new(
|
23
|
+
# Whether automatic thread titling is enabled.
|
24
|
+
enabled:
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
sig { override.returns({ enabled: T::Boolean }) }
|
29
|
+
def to_hash
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatSessionChatKitConfiguration < OpenAI::Internal::Type::BaseModel
|
8
|
+
OrHash =
|
9
|
+
T.type_alias do
|
10
|
+
T.any(
|
11
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfiguration,
|
12
|
+
OpenAI::Internal::AnyHash
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Automatic thread titling preferences.
|
17
|
+
sig do
|
18
|
+
returns(OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling)
|
19
|
+
end
|
20
|
+
attr_reader :automatic_thread_titling
|
21
|
+
|
22
|
+
sig do
|
23
|
+
params(
|
24
|
+
automatic_thread_titling:
|
25
|
+
OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling::OrHash
|
26
|
+
).void
|
27
|
+
end
|
28
|
+
attr_writer :automatic_thread_titling
|
29
|
+
|
30
|
+
# Upload settings for the session.
|
31
|
+
sig { returns(OpenAI::Beta::ChatKit::ChatSessionFileUpload) }
|
32
|
+
attr_reader :file_upload
|
33
|
+
|
34
|
+
sig do
|
35
|
+
params(
|
36
|
+
file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload::OrHash
|
37
|
+
).void
|
38
|
+
end
|
39
|
+
attr_writer :file_upload
|
40
|
+
|
41
|
+
# History retention configuration.
|
42
|
+
sig { returns(OpenAI::Beta::ChatKit::ChatSessionHistory) }
|
43
|
+
attr_reader :history
|
44
|
+
|
45
|
+
sig do
|
46
|
+
params(
|
47
|
+
history: OpenAI::Beta::ChatKit::ChatSessionHistory::OrHash
|
48
|
+
).void
|
49
|
+
end
|
50
|
+
attr_writer :history
|
51
|
+
|
52
|
+
# ChatKit configuration for the session.
|
53
|
+
sig do
|
54
|
+
params(
|
55
|
+
automatic_thread_titling:
|
56
|
+
OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling::OrHash,
|
57
|
+
file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload::OrHash,
|
58
|
+
history: OpenAI::Beta::ChatKit::ChatSessionHistory::OrHash
|
59
|
+
).returns(T.attached_class)
|
60
|
+
end
|
61
|
+
def self.new(
|
62
|
+
# Automatic thread titling preferences.
|
63
|
+
automatic_thread_titling:,
|
64
|
+
# Upload settings for the session.
|
65
|
+
file_upload:,
|
66
|
+
# History retention configuration.
|
67
|
+
history:
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
sig do
|
72
|
+
override.returns(
|
73
|
+
{
|
74
|
+
automatic_thread_titling:
|
75
|
+
OpenAI::Beta::ChatKit::ChatSessionAutomaticThreadTitling,
|
76
|
+
file_upload: OpenAI::Beta::ChatKit::ChatSessionFileUpload,
|
77
|
+
history: OpenAI::Beta::ChatKit::ChatSessionHistory
|
78
|
+
}
|
79
|
+
)
|
80
|
+
end
|
81
|
+
def to_hash
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,256 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatSessionChatKitConfigurationParam < OpenAI::Internal::Type::BaseModel
|
8
|
+
OrHash =
|
9
|
+
T.type_alias do
|
10
|
+
T.any(
|
11
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam,
|
12
|
+
OpenAI::Internal::AnyHash
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Configuration for automatic thread titling. When omitted, automatic thread
|
17
|
+
# titling is enabled by default.
|
18
|
+
sig do
|
19
|
+
returns(
|
20
|
+
T.nilable(
|
21
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling
|
22
|
+
)
|
23
|
+
)
|
24
|
+
end
|
25
|
+
attr_reader :automatic_thread_titling
|
26
|
+
|
27
|
+
sig do
|
28
|
+
params(
|
29
|
+
automatic_thread_titling:
|
30
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling::OrHash
|
31
|
+
).void
|
32
|
+
end
|
33
|
+
attr_writer :automatic_thread_titling
|
34
|
+
|
35
|
+
# Configuration for upload enablement and limits. When omitted, uploads are
|
36
|
+
# disabled by default (max_files 10, max_file_size 512 MB).
|
37
|
+
sig do
|
38
|
+
returns(
|
39
|
+
T.nilable(
|
40
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload
|
41
|
+
)
|
42
|
+
)
|
43
|
+
end
|
44
|
+
attr_reader :file_upload
|
45
|
+
|
46
|
+
sig do
|
47
|
+
params(
|
48
|
+
file_upload:
|
49
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload::OrHash
|
50
|
+
).void
|
51
|
+
end
|
52
|
+
attr_writer :file_upload
|
53
|
+
|
54
|
+
# Configuration for chat history retention. When omitted, history is enabled by
|
55
|
+
# default with no limit on recent_threads (null).
|
56
|
+
sig do
|
57
|
+
returns(
|
58
|
+
T.nilable(
|
59
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History
|
60
|
+
)
|
61
|
+
)
|
62
|
+
end
|
63
|
+
attr_reader :history
|
64
|
+
|
65
|
+
sig do
|
66
|
+
params(
|
67
|
+
history:
|
68
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History::OrHash
|
69
|
+
).void
|
70
|
+
end
|
71
|
+
attr_writer :history
|
72
|
+
|
73
|
+
# Optional per-session configuration settings for ChatKit behavior.
|
74
|
+
sig do
|
75
|
+
params(
|
76
|
+
automatic_thread_titling:
|
77
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling::OrHash,
|
78
|
+
file_upload:
|
79
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload::OrHash,
|
80
|
+
history:
|
81
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History::OrHash
|
82
|
+
).returns(T.attached_class)
|
83
|
+
end
|
84
|
+
def self.new(
|
85
|
+
# Configuration for automatic thread titling. When omitted, automatic thread
|
86
|
+
# titling is enabled by default.
|
87
|
+
automatic_thread_titling: nil,
|
88
|
+
# Configuration for upload enablement and limits. When omitted, uploads are
|
89
|
+
# disabled by default (max_files 10, max_file_size 512 MB).
|
90
|
+
file_upload: nil,
|
91
|
+
# Configuration for chat history retention. When omitted, history is enabled by
|
92
|
+
# default with no limit on recent_threads (null).
|
93
|
+
history: nil
|
94
|
+
)
|
95
|
+
end
|
96
|
+
|
97
|
+
sig do
|
98
|
+
override.returns(
|
99
|
+
{
|
100
|
+
automatic_thread_titling:
|
101
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling,
|
102
|
+
file_upload:
|
103
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload,
|
104
|
+
history:
|
105
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History
|
106
|
+
}
|
107
|
+
)
|
108
|
+
end
|
109
|
+
def to_hash
|
110
|
+
end
|
111
|
+
|
112
|
+
class AutomaticThreadTitling < OpenAI::Internal::Type::BaseModel
|
113
|
+
OrHash =
|
114
|
+
T.type_alias do
|
115
|
+
T.any(
|
116
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::AutomaticThreadTitling,
|
117
|
+
OpenAI::Internal::AnyHash
|
118
|
+
)
|
119
|
+
end
|
120
|
+
|
121
|
+
# Enable automatic thread title generation. Defaults to true.
|
122
|
+
sig { returns(T.nilable(T::Boolean)) }
|
123
|
+
attr_reader :enabled
|
124
|
+
|
125
|
+
sig { params(enabled: T::Boolean).void }
|
126
|
+
attr_writer :enabled
|
127
|
+
|
128
|
+
# Configuration for automatic thread titling. When omitted, automatic thread
|
129
|
+
# titling is enabled by default.
|
130
|
+
sig { params(enabled: T::Boolean).returns(T.attached_class) }
|
131
|
+
def self.new(
|
132
|
+
# Enable automatic thread title generation. Defaults to true.
|
133
|
+
enabled: nil
|
134
|
+
)
|
135
|
+
end
|
136
|
+
|
137
|
+
sig { override.returns({ enabled: T::Boolean }) }
|
138
|
+
def to_hash
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
class FileUpload < OpenAI::Internal::Type::BaseModel
|
143
|
+
OrHash =
|
144
|
+
T.type_alias do
|
145
|
+
T.any(
|
146
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::FileUpload,
|
147
|
+
OpenAI::Internal::AnyHash
|
148
|
+
)
|
149
|
+
end
|
150
|
+
|
151
|
+
# Enable uploads for this session. Defaults to false.
|
152
|
+
sig { returns(T.nilable(T::Boolean)) }
|
153
|
+
attr_reader :enabled
|
154
|
+
|
155
|
+
sig { params(enabled: T::Boolean).void }
|
156
|
+
attr_writer :enabled
|
157
|
+
|
158
|
+
# Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is
|
159
|
+
# the maximum allowable size.
|
160
|
+
sig { returns(T.nilable(Integer)) }
|
161
|
+
attr_reader :max_file_size
|
162
|
+
|
163
|
+
sig { params(max_file_size: Integer).void }
|
164
|
+
attr_writer :max_file_size
|
165
|
+
|
166
|
+
# Maximum number of files that can be uploaded to the session. Defaults to 10.
|
167
|
+
sig { returns(T.nilable(Integer)) }
|
168
|
+
attr_reader :max_files
|
169
|
+
|
170
|
+
sig { params(max_files: Integer).void }
|
171
|
+
attr_writer :max_files
|
172
|
+
|
173
|
+
# Configuration for upload enablement and limits. When omitted, uploads are
|
174
|
+
# disabled by default (max_files 10, max_file_size 512 MB).
|
175
|
+
sig do
|
176
|
+
params(
|
177
|
+
enabled: T::Boolean,
|
178
|
+
max_file_size: Integer,
|
179
|
+
max_files: Integer
|
180
|
+
).returns(T.attached_class)
|
181
|
+
end
|
182
|
+
def self.new(
|
183
|
+
# Enable uploads for this session. Defaults to false.
|
184
|
+
enabled: nil,
|
185
|
+
# Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is
|
186
|
+
# the maximum allowable size.
|
187
|
+
max_file_size: nil,
|
188
|
+
# Maximum number of files that can be uploaded to the session. Defaults to 10.
|
189
|
+
max_files: nil
|
190
|
+
)
|
191
|
+
end
|
192
|
+
|
193
|
+
sig do
|
194
|
+
override.returns(
|
195
|
+
{
|
196
|
+
enabled: T::Boolean,
|
197
|
+
max_file_size: Integer,
|
198
|
+
max_files: Integer
|
199
|
+
}
|
200
|
+
)
|
201
|
+
end
|
202
|
+
def to_hash
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
class History < OpenAI::Internal::Type::BaseModel
|
207
|
+
OrHash =
|
208
|
+
T.type_alias do
|
209
|
+
T.any(
|
210
|
+
OpenAI::Beta::ChatKit::ChatSessionChatKitConfigurationParam::History,
|
211
|
+
OpenAI::Internal::AnyHash
|
212
|
+
)
|
213
|
+
end
|
214
|
+
|
215
|
+
# Enables chat users to access previous ChatKit threads. Defaults to true.
|
216
|
+
sig { returns(T.nilable(T::Boolean)) }
|
217
|
+
attr_reader :enabled
|
218
|
+
|
219
|
+
sig { params(enabled: T::Boolean).void }
|
220
|
+
attr_writer :enabled
|
221
|
+
|
222
|
+
# Number of recent ChatKit threads users have access to. Defaults to unlimited
|
223
|
+
# when unset.
|
224
|
+
sig { returns(T.nilable(Integer)) }
|
225
|
+
attr_reader :recent_threads
|
226
|
+
|
227
|
+
sig { params(recent_threads: Integer).void }
|
228
|
+
attr_writer :recent_threads
|
229
|
+
|
230
|
+
# Configuration for chat history retention. When omitted, history is enabled by
|
231
|
+
# default with no limit on recent_threads (null).
|
232
|
+
sig do
|
233
|
+
params(enabled: T::Boolean, recent_threads: Integer).returns(
|
234
|
+
T.attached_class
|
235
|
+
)
|
236
|
+
end
|
237
|
+
def self.new(
|
238
|
+
# Enables chat users to access previous ChatKit threads. Defaults to true.
|
239
|
+
enabled: nil,
|
240
|
+
# Number of recent ChatKit threads users have access to. Defaults to unlimited
|
241
|
+
# when unset.
|
242
|
+
recent_threads: nil
|
243
|
+
)
|
244
|
+
end
|
245
|
+
|
246
|
+
sig do
|
247
|
+
override.returns({ enabled: T::Boolean, recent_threads: Integer })
|
248
|
+
end
|
249
|
+
def to_hash
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatSessionExpiresAfterParam < OpenAI::Internal::Type::BaseModel
|
8
|
+
OrHash =
|
9
|
+
T.type_alias do
|
10
|
+
T.any(
|
11
|
+
OpenAI::Beta::ChatKit::ChatSessionExpiresAfterParam,
|
12
|
+
OpenAI::Internal::AnyHash
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Base timestamp used to calculate expiration. Currently fixed to `created_at`.
|
17
|
+
sig { returns(Symbol) }
|
18
|
+
attr_accessor :anchor
|
19
|
+
|
20
|
+
# Number of seconds after the anchor when the session expires.
|
21
|
+
sig { returns(Integer) }
|
22
|
+
attr_accessor :seconds
|
23
|
+
|
24
|
+
# Controls when the session expires relative to an anchor timestamp.
|
25
|
+
sig do
|
26
|
+
params(seconds: Integer, anchor: Symbol).returns(T.attached_class)
|
27
|
+
end
|
28
|
+
def self.new(
|
29
|
+
# Number of seconds after the anchor when the session expires.
|
30
|
+
seconds:,
|
31
|
+
# Base timestamp used to calculate expiration. Currently fixed to `created_at`.
|
32
|
+
anchor: :created_at
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
sig { override.returns({ anchor: Symbol, seconds: Integer }) }
|
37
|
+
def to_hash
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatSessionFileUpload < OpenAI::Internal::Type::BaseModel
|
8
|
+
OrHash =
|
9
|
+
T.type_alias do
|
10
|
+
T.any(
|
11
|
+
OpenAI::Beta::ChatKit::ChatSessionFileUpload,
|
12
|
+
OpenAI::Internal::AnyHash
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Indicates if uploads are enabled for the session.
|
17
|
+
sig { returns(T::Boolean) }
|
18
|
+
attr_accessor :enabled
|
19
|
+
|
20
|
+
# Maximum upload size in megabytes.
|
21
|
+
sig { returns(T.nilable(Integer)) }
|
22
|
+
attr_accessor :max_file_size
|
23
|
+
|
24
|
+
# Maximum number of uploads allowed during the session.
|
25
|
+
sig { returns(T.nilable(Integer)) }
|
26
|
+
attr_accessor :max_files
|
27
|
+
|
28
|
+
# Upload permissions and limits applied to the session.
|
29
|
+
sig do
|
30
|
+
params(
|
31
|
+
enabled: T::Boolean,
|
32
|
+
max_file_size: T.nilable(Integer),
|
33
|
+
max_files: T.nilable(Integer)
|
34
|
+
).returns(T.attached_class)
|
35
|
+
end
|
36
|
+
def self.new(
|
37
|
+
# Indicates if uploads are enabled for the session.
|
38
|
+
enabled:,
|
39
|
+
# Maximum upload size in megabytes.
|
40
|
+
max_file_size:,
|
41
|
+
# Maximum number of uploads allowed during the session.
|
42
|
+
max_files:
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
sig do
|
47
|
+
override.returns(
|
48
|
+
{
|
49
|
+
enabled: T::Boolean,
|
50
|
+
max_file_size: T.nilable(Integer),
|
51
|
+
max_files: T.nilable(Integer)
|
52
|
+
}
|
53
|
+
)
|
54
|
+
end
|
55
|
+
def to_hash
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
module ChatKit
|
7
|
+
class ChatSessionHistory < OpenAI::Internal::Type::BaseModel
|
8
|
+
OrHash =
|
9
|
+
T.type_alias do
|
10
|
+
T.any(
|
11
|
+
OpenAI::Beta::ChatKit::ChatSessionHistory,
|
12
|
+
OpenAI::Internal::AnyHash
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Indicates if chat history is persisted for the session.
|
17
|
+
sig { returns(T::Boolean) }
|
18
|
+
attr_accessor :enabled
|
19
|
+
|
20
|
+
# Number of prior threads surfaced in history views. Defaults to null when all
|
21
|
+
# history is retained.
|
22
|
+
sig { returns(T.nilable(Integer)) }
|
23
|
+
attr_accessor :recent_threads
|
24
|
+
|
25
|
+
# History retention preferences returned for the session.
|
26
|
+
sig do
|
27
|
+
params(
|
28
|
+
enabled: T::Boolean,
|
29
|
+
recent_threads: T.nilable(Integer)
|
30
|
+
).returns(T.attached_class)
|
31
|
+
end
|
32
|
+
def self.new(
|
33
|
+
# Indicates if chat history is persisted for the session.
|
34
|
+
enabled:,
|
35
|
+
# Number of prior threads surfaced in history views. Defaults to null when all
|
36
|
+
# history is retained.
|
37
|
+
recent_threads:
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
sig do
|
42
|
+
override.returns(
|
43
|
+
{ enabled: T::Boolean, recent_threads: T.nilable(Integer) }
|
44
|
+
)
|
45
|
+
end
|
46
|
+
def to_hash
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|