openai 0.10.0 → 0.11.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 +20 -0
- data/README.md +79 -1
- data/lib/openai/client.rb +11 -0
- data/lib/openai/errors.rb +3 -0
- data/lib/openai/models/all_models.rb +4 -0
- data/lib/openai/models/chat/chat_completion.rb +32 -31
- data/lib/openai/models/chat/chat_completion_chunk.rb +30 -29
- data/lib/openai/models/chat/completion_create_params.rb +34 -31
- data/lib/openai/models/images_response.rb +92 -1
- data/lib/openai/models/responses/response.rb +59 -35
- data/lib/openai/models/responses/response_create_params.rb +64 -39
- data/lib/openai/models/responses/response_function_web_search.rb +115 -1
- data/lib/openai/models/responses/response_includable.rb +8 -6
- data/lib/openai/models/responses/tool_choice_mcp.rb +40 -0
- data/lib/openai/models/responses/tool_choice_types.rb +0 -3
- data/lib/openai/models/responses_model.rb +4 -0
- data/lib/openai/models/webhooks/batch_cancelled_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/batch_completed_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/batch_expired_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/batch_failed_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/eval_run_canceled_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/eval_run_failed_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/eval_run_succeeded_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/fine_tuning_job_cancelled_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/fine_tuning_job_failed_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/fine_tuning_job_succeeded_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/response_cancelled_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/response_completed_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/response_failed_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/response_incomplete_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +59 -0
- data/lib/openai/models/webhooks/webhook_unwrap_params.rb +16 -0
- data/lib/openai/models.rb +2 -0
- data/lib/openai/resources/chat/completions.rb +2 -2
- data/lib/openai/resources/responses.rb +14 -6
- data/lib/openai/resources/webhooks.rb +124 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +18 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/models/all_models.rbi +20 -0
- data/rbi/openai/models/chat/chat_completion.rbi +47 -42
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +47 -42
- data/rbi/openai/models/chat/completion_create_params.rbi +51 -42
- data/rbi/openai/models/images_response.rbi +146 -0
- data/rbi/openai/models/responses/response.rbi +75 -44
- data/rbi/openai/models/responses/response_create_params.rbi +91 -55
- data/rbi/openai/models/responses/response_function_web_search.rbi +163 -0
- data/rbi/openai/models/responses/response_includable.rbi +17 -11
- data/rbi/openai/models/responses/tool_choice_mcp.rbi +53 -0
- data/rbi/openai/models/responses/tool_choice_types.rbi +0 -5
- data/rbi/openai/models/responses_model.rbi +20 -0
- data/rbi/openai/models/webhooks/batch_cancelled_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/batch_completed_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/batch_expired_webhook_event.rbi +150 -0
- data/rbi/openai/models/webhooks/batch_failed_webhook_event.rbi +149 -0
- data/rbi/openai/models/webhooks/eval_run_canceled_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/eval_run_failed_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/eval_run_succeeded_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/fine_tuning_job_cancelled_webhook_event.rbi +158 -0
- data/rbi/openai/models/webhooks/fine_tuning_job_failed_webhook_event.rbi +156 -0
- data/rbi/openai/models/webhooks/fine_tuning_job_succeeded_webhook_event.rbi +158 -0
- data/rbi/openai/models/webhooks/response_cancelled_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/response_completed_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/response_failed_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/response_incomplete_webhook_event.rbi +155 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +40 -0
- data/rbi/openai/models/webhooks/webhook_unwrap_params.rbi +32 -0
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/chat/completions.rbi +34 -30
- data/rbi/openai/resources/responses.rbi +62 -38
- data/rbi/openai/resources/webhooks.rbi +68 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/models/all_models.rbs +8 -0
- data/sig/openai/models/chat/chat_completion.rbs +2 -1
- data/sig/openai/models/chat/chat_completion_chunk.rbs +2 -1
- data/sig/openai/models/chat/completion_create_params.rbs +2 -1
- data/sig/openai/models/images_response.rbs +83 -0
- data/sig/openai/models/responses/response.rbs +13 -1
- data/sig/openai/models/responses/response_create_params.rbs +13 -1
- data/sig/openai/models/responses/response_function_web_search.rbs +54 -0
- data/sig/openai/models/responses/response_includable.rbs +7 -5
- data/sig/openai/models/responses/tool_choice_mcp.rbs +23 -0
- data/sig/openai/models/responses/tool_choice_types.rbs +0 -2
- data/sig/openai/models/responses_model.rbs +8 -0
- data/sig/openai/models/webhooks/batch_cancelled_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/batch_completed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/batch_expired_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/batch_failed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/eval_run_canceled_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/eval_run_failed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/eval_run_succeeded_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/fine_tuning_job_cancelled_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/fine_tuning_job_failed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/fine_tuning_job_succeeded_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/response_cancelled_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/response_completed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/response_failed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/response_incomplete_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +27 -0
- data/sig/openai/models/webhooks/webhook_unwrap_params.rbs +17 -0
- data/sig/openai/models.rbs +2 -0
- data/sig/openai/resources/responses.rbs +4 -0
- data/sig/openai/resources/webhooks.rbs +33 -0
- metadata +56 -2
@@ -0,0 +1,154 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Webhooks
|
6
|
+
class BatchCancelledWebhookEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(
|
10
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent,
|
11
|
+
OpenAI::Internal::AnyHash
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
# The unique ID of the event.
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
# The Unix timestamp (in seconds) of when the batch API request was cancelled.
|
20
|
+
sig { returns(Integer) }
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
# Event data payload.
|
24
|
+
sig { returns(OpenAI::Webhooks::BatchCancelledWebhookEvent::Data) }
|
25
|
+
attr_reader :data
|
26
|
+
|
27
|
+
sig do
|
28
|
+
params(
|
29
|
+
data: OpenAI::Webhooks::BatchCancelledWebhookEvent::Data::OrHash
|
30
|
+
).void
|
31
|
+
end
|
32
|
+
attr_writer :data
|
33
|
+
|
34
|
+
# The type of the event. Always `batch.cancelled`.
|
35
|
+
sig { returns(Symbol) }
|
36
|
+
attr_accessor :type
|
37
|
+
|
38
|
+
# The object of the event. Always `event`.
|
39
|
+
sig do
|
40
|
+
returns(
|
41
|
+
T.nilable(
|
42
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::TaggedSymbol
|
43
|
+
)
|
44
|
+
)
|
45
|
+
end
|
46
|
+
attr_reader :object
|
47
|
+
|
48
|
+
sig do
|
49
|
+
params(
|
50
|
+
object:
|
51
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::OrSymbol
|
52
|
+
).void
|
53
|
+
end
|
54
|
+
attr_writer :object
|
55
|
+
|
56
|
+
# Sent when a batch API request has been cancelled.
|
57
|
+
sig do
|
58
|
+
params(
|
59
|
+
id: String,
|
60
|
+
created_at: Integer,
|
61
|
+
data: OpenAI::Webhooks::BatchCancelledWebhookEvent::Data::OrHash,
|
62
|
+
object:
|
63
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::OrSymbol,
|
64
|
+
type: Symbol
|
65
|
+
).returns(T.attached_class)
|
66
|
+
end
|
67
|
+
def self.new(
|
68
|
+
# The unique ID of the event.
|
69
|
+
id:,
|
70
|
+
# The Unix timestamp (in seconds) of when the batch API request was cancelled.
|
71
|
+
created_at:,
|
72
|
+
# Event data payload.
|
73
|
+
data:,
|
74
|
+
# The object of the event. Always `event`.
|
75
|
+
object: nil,
|
76
|
+
# The type of the event. Always `batch.cancelled`.
|
77
|
+
type: :"batch.cancelled"
|
78
|
+
)
|
79
|
+
end
|
80
|
+
|
81
|
+
sig do
|
82
|
+
override.returns(
|
83
|
+
{
|
84
|
+
id: String,
|
85
|
+
created_at: Integer,
|
86
|
+
data: OpenAI::Webhooks::BatchCancelledWebhookEvent::Data,
|
87
|
+
type: Symbol,
|
88
|
+
object:
|
89
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::TaggedSymbol
|
90
|
+
}
|
91
|
+
)
|
92
|
+
end
|
93
|
+
def to_hash
|
94
|
+
end
|
95
|
+
|
96
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
97
|
+
OrHash =
|
98
|
+
T.type_alias do
|
99
|
+
T.any(
|
100
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Data,
|
101
|
+
OpenAI::Internal::AnyHash
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
# The unique ID of the batch API request.
|
106
|
+
sig { returns(String) }
|
107
|
+
attr_accessor :id
|
108
|
+
|
109
|
+
# Event data payload.
|
110
|
+
sig { params(id: String).returns(T.attached_class) }
|
111
|
+
def self.new(
|
112
|
+
# The unique ID of the batch API request.
|
113
|
+
id:
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
117
|
+
sig { override.returns({ id: String }) }
|
118
|
+
def to_hash
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# The object of the event. Always `event`.
|
123
|
+
module Object
|
124
|
+
extend OpenAI::Internal::Type::Enum
|
125
|
+
|
126
|
+
TaggedSymbol =
|
127
|
+
T.type_alias do
|
128
|
+
T.all(
|
129
|
+
Symbol,
|
130
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object
|
131
|
+
)
|
132
|
+
end
|
133
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
134
|
+
|
135
|
+
EVENT =
|
136
|
+
T.let(
|
137
|
+
:event,
|
138
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::TaggedSymbol
|
139
|
+
)
|
140
|
+
|
141
|
+
sig do
|
142
|
+
override.returns(
|
143
|
+
T::Array[
|
144
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::TaggedSymbol
|
145
|
+
]
|
146
|
+
)
|
147
|
+
end
|
148
|
+
def self.values
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Webhooks
|
6
|
+
class BatchCompletedWebhookEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(
|
10
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent,
|
11
|
+
OpenAI::Internal::AnyHash
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
# The unique ID of the event.
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
# The Unix timestamp (in seconds) of when the batch API request was completed.
|
20
|
+
sig { returns(Integer) }
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
# Event data payload.
|
24
|
+
sig { returns(OpenAI::Webhooks::BatchCompletedWebhookEvent::Data) }
|
25
|
+
attr_reader :data
|
26
|
+
|
27
|
+
sig do
|
28
|
+
params(
|
29
|
+
data: OpenAI::Webhooks::BatchCompletedWebhookEvent::Data::OrHash
|
30
|
+
).void
|
31
|
+
end
|
32
|
+
attr_writer :data
|
33
|
+
|
34
|
+
# The type of the event. Always `batch.completed`.
|
35
|
+
sig { returns(Symbol) }
|
36
|
+
attr_accessor :type
|
37
|
+
|
38
|
+
# The object of the event. Always `event`.
|
39
|
+
sig do
|
40
|
+
returns(
|
41
|
+
T.nilable(
|
42
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent::Object::TaggedSymbol
|
43
|
+
)
|
44
|
+
)
|
45
|
+
end
|
46
|
+
attr_reader :object
|
47
|
+
|
48
|
+
sig do
|
49
|
+
params(
|
50
|
+
object:
|
51
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent::Object::OrSymbol
|
52
|
+
).void
|
53
|
+
end
|
54
|
+
attr_writer :object
|
55
|
+
|
56
|
+
# Sent when a batch API request has been completed.
|
57
|
+
sig do
|
58
|
+
params(
|
59
|
+
id: String,
|
60
|
+
created_at: Integer,
|
61
|
+
data: OpenAI::Webhooks::BatchCompletedWebhookEvent::Data::OrHash,
|
62
|
+
object:
|
63
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent::Object::OrSymbol,
|
64
|
+
type: Symbol
|
65
|
+
).returns(T.attached_class)
|
66
|
+
end
|
67
|
+
def self.new(
|
68
|
+
# The unique ID of the event.
|
69
|
+
id:,
|
70
|
+
# The Unix timestamp (in seconds) of when the batch API request was completed.
|
71
|
+
created_at:,
|
72
|
+
# Event data payload.
|
73
|
+
data:,
|
74
|
+
# The object of the event. Always `event`.
|
75
|
+
object: nil,
|
76
|
+
# The type of the event. Always `batch.completed`.
|
77
|
+
type: :"batch.completed"
|
78
|
+
)
|
79
|
+
end
|
80
|
+
|
81
|
+
sig do
|
82
|
+
override.returns(
|
83
|
+
{
|
84
|
+
id: String,
|
85
|
+
created_at: Integer,
|
86
|
+
data: OpenAI::Webhooks::BatchCompletedWebhookEvent::Data,
|
87
|
+
type: Symbol,
|
88
|
+
object:
|
89
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent::Object::TaggedSymbol
|
90
|
+
}
|
91
|
+
)
|
92
|
+
end
|
93
|
+
def to_hash
|
94
|
+
end
|
95
|
+
|
96
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
97
|
+
OrHash =
|
98
|
+
T.type_alias do
|
99
|
+
T.any(
|
100
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent::Data,
|
101
|
+
OpenAI::Internal::AnyHash
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
# The unique ID of the batch API request.
|
106
|
+
sig { returns(String) }
|
107
|
+
attr_accessor :id
|
108
|
+
|
109
|
+
# Event data payload.
|
110
|
+
sig { params(id: String).returns(T.attached_class) }
|
111
|
+
def self.new(
|
112
|
+
# The unique ID of the batch API request.
|
113
|
+
id:
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
117
|
+
sig { override.returns({ id: String }) }
|
118
|
+
def to_hash
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# The object of the event. Always `event`.
|
123
|
+
module Object
|
124
|
+
extend OpenAI::Internal::Type::Enum
|
125
|
+
|
126
|
+
TaggedSymbol =
|
127
|
+
T.type_alias do
|
128
|
+
T.all(
|
129
|
+
Symbol,
|
130
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent::Object
|
131
|
+
)
|
132
|
+
end
|
133
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
134
|
+
|
135
|
+
EVENT =
|
136
|
+
T.let(
|
137
|
+
:event,
|
138
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent::Object::TaggedSymbol
|
139
|
+
)
|
140
|
+
|
141
|
+
sig do
|
142
|
+
override.returns(
|
143
|
+
T::Array[
|
144
|
+
OpenAI::Webhooks::BatchCompletedWebhookEvent::Object::TaggedSymbol
|
145
|
+
]
|
146
|
+
)
|
147
|
+
end
|
148
|
+
def self.values
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
@@ -0,0 +1,150 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Webhooks
|
6
|
+
class BatchExpiredWebhookEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(
|
10
|
+
OpenAI::Webhooks::BatchExpiredWebhookEvent,
|
11
|
+
OpenAI::Internal::AnyHash
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
# The unique ID of the event.
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
# The Unix timestamp (in seconds) of when the batch API request expired.
|
20
|
+
sig { returns(Integer) }
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
# Event data payload.
|
24
|
+
sig { returns(OpenAI::Webhooks::BatchExpiredWebhookEvent::Data) }
|
25
|
+
attr_reader :data
|
26
|
+
|
27
|
+
sig do
|
28
|
+
params(
|
29
|
+
data: OpenAI::Webhooks::BatchExpiredWebhookEvent::Data::OrHash
|
30
|
+
).void
|
31
|
+
end
|
32
|
+
attr_writer :data
|
33
|
+
|
34
|
+
# The type of the event. Always `batch.expired`.
|
35
|
+
sig { returns(Symbol) }
|
36
|
+
attr_accessor :type
|
37
|
+
|
38
|
+
# The object of the event. Always `event`.
|
39
|
+
sig do
|
40
|
+
returns(
|
41
|
+
T.nilable(
|
42
|
+
OpenAI::Webhooks::BatchExpiredWebhookEvent::Object::TaggedSymbol
|
43
|
+
)
|
44
|
+
)
|
45
|
+
end
|
46
|
+
attr_reader :object
|
47
|
+
|
48
|
+
sig do
|
49
|
+
params(
|
50
|
+
object: OpenAI::Webhooks::BatchExpiredWebhookEvent::Object::OrSymbol
|
51
|
+
).void
|
52
|
+
end
|
53
|
+
attr_writer :object
|
54
|
+
|
55
|
+
# Sent when a batch API request has expired.
|
56
|
+
sig do
|
57
|
+
params(
|
58
|
+
id: String,
|
59
|
+
created_at: Integer,
|
60
|
+
data: OpenAI::Webhooks::BatchExpiredWebhookEvent::Data::OrHash,
|
61
|
+
object:
|
62
|
+
OpenAI::Webhooks::BatchExpiredWebhookEvent::Object::OrSymbol,
|
63
|
+
type: Symbol
|
64
|
+
).returns(T.attached_class)
|
65
|
+
end
|
66
|
+
def self.new(
|
67
|
+
# The unique ID of the event.
|
68
|
+
id:,
|
69
|
+
# The Unix timestamp (in seconds) of when the batch API request expired.
|
70
|
+
created_at:,
|
71
|
+
# Event data payload.
|
72
|
+
data:,
|
73
|
+
# The object of the event. Always `event`.
|
74
|
+
object: nil,
|
75
|
+
# The type of the event. Always `batch.expired`.
|
76
|
+
type: :"batch.expired"
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
sig do
|
81
|
+
override.returns(
|
82
|
+
{
|
83
|
+
id: String,
|
84
|
+
created_at: Integer,
|
85
|
+
data: OpenAI::Webhooks::BatchExpiredWebhookEvent::Data,
|
86
|
+
type: Symbol,
|
87
|
+
object:
|
88
|
+
OpenAI::Webhooks::BatchExpiredWebhookEvent::Object::TaggedSymbol
|
89
|
+
}
|
90
|
+
)
|
91
|
+
end
|
92
|
+
def to_hash
|
93
|
+
end
|
94
|
+
|
95
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
96
|
+
OrHash =
|
97
|
+
T.type_alias do
|
98
|
+
T.any(
|
99
|
+
OpenAI::Webhooks::BatchExpiredWebhookEvent::Data,
|
100
|
+
OpenAI::Internal::AnyHash
|
101
|
+
)
|
102
|
+
end
|
103
|
+
|
104
|
+
# The unique ID of the batch API request.
|
105
|
+
sig { returns(String) }
|
106
|
+
attr_accessor :id
|
107
|
+
|
108
|
+
# Event data payload.
|
109
|
+
sig { params(id: String).returns(T.attached_class) }
|
110
|
+
def self.new(
|
111
|
+
# The unique ID of the batch API request.
|
112
|
+
id:
|
113
|
+
)
|
114
|
+
end
|
115
|
+
|
116
|
+
sig { override.returns({ id: String }) }
|
117
|
+
def to_hash
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
# The object of the event. Always `event`.
|
122
|
+
module Object
|
123
|
+
extend OpenAI::Internal::Type::Enum
|
124
|
+
|
125
|
+
TaggedSymbol =
|
126
|
+
T.type_alias do
|
127
|
+
T.all(Symbol, OpenAI::Webhooks::BatchExpiredWebhookEvent::Object)
|
128
|
+
end
|
129
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
130
|
+
|
131
|
+
EVENT =
|
132
|
+
T.let(
|
133
|
+
:event,
|
134
|
+
OpenAI::Webhooks::BatchExpiredWebhookEvent::Object::TaggedSymbol
|
135
|
+
)
|
136
|
+
|
137
|
+
sig do
|
138
|
+
override.returns(
|
139
|
+
T::Array[
|
140
|
+
OpenAI::Webhooks::BatchExpiredWebhookEvent::Object::TaggedSymbol
|
141
|
+
]
|
142
|
+
)
|
143
|
+
end
|
144
|
+
def self.values
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Webhooks
|
6
|
+
class BatchFailedWebhookEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(
|
10
|
+
OpenAI::Webhooks::BatchFailedWebhookEvent,
|
11
|
+
OpenAI::Internal::AnyHash
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
# The unique ID of the event.
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
# The Unix timestamp (in seconds) of when the batch API request failed.
|
20
|
+
sig { returns(Integer) }
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
# Event data payload.
|
24
|
+
sig { returns(OpenAI::Webhooks::BatchFailedWebhookEvent::Data) }
|
25
|
+
attr_reader :data
|
26
|
+
|
27
|
+
sig do
|
28
|
+
params(
|
29
|
+
data: OpenAI::Webhooks::BatchFailedWebhookEvent::Data::OrHash
|
30
|
+
).void
|
31
|
+
end
|
32
|
+
attr_writer :data
|
33
|
+
|
34
|
+
# The type of the event. Always `batch.failed`.
|
35
|
+
sig { returns(Symbol) }
|
36
|
+
attr_accessor :type
|
37
|
+
|
38
|
+
# The object of the event. Always `event`.
|
39
|
+
sig do
|
40
|
+
returns(
|
41
|
+
T.nilable(
|
42
|
+
OpenAI::Webhooks::BatchFailedWebhookEvent::Object::TaggedSymbol
|
43
|
+
)
|
44
|
+
)
|
45
|
+
end
|
46
|
+
attr_reader :object
|
47
|
+
|
48
|
+
sig do
|
49
|
+
params(
|
50
|
+
object: OpenAI::Webhooks::BatchFailedWebhookEvent::Object::OrSymbol
|
51
|
+
).void
|
52
|
+
end
|
53
|
+
attr_writer :object
|
54
|
+
|
55
|
+
# Sent when a batch API request has failed.
|
56
|
+
sig do
|
57
|
+
params(
|
58
|
+
id: String,
|
59
|
+
created_at: Integer,
|
60
|
+
data: OpenAI::Webhooks::BatchFailedWebhookEvent::Data::OrHash,
|
61
|
+
object: OpenAI::Webhooks::BatchFailedWebhookEvent::Object::OrSymbol,
|
62
|
+
type: Symbol
|
63
|
+
).returns(T.attached_class)
|
64
|
+
end
|
65
|
+
def self.new(
|
66
|
+
# The unique ID of the event.
|
67
|
+
id:,
|
68
|
+
# The Unix timestamp (in seconds) of when the batch API request failed.
|
69
|
+
created_at:,
|
70
|
+
# Event data payload.
|
71
|
+
data:,
|
72
|
+
# The object of the event. Always `event`.
|
73
|
+
object: nil,
|
74
|
+
# The type of the event. Always `batch.failed`.
|
75
|
+
type: :"batch.failed"
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
sig do
|
80
|
+
override.returns(
|
81
|
+
{
|
82
|
+
id: String,
|
83
|
+
created_at: Integer,
|
84
|
+
data: OpenAI::Webhooks::BatchFailedWebhookEvent::Data,
|
85
|
+
type: Symbol,
|
86
|
+
object:
|
87
|
+
OpenAI::Webhooks::BatchFailedWebhookEvent::Object::TaggedSymbol
|
88
|
+
}
|
89
|
+
)
|
90
|
+
end
|
91
|
+
def to_hash
|
92
|
+
end
|
93
|
+
|
94
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
95
|
+
OrHash =
|
96
|
+
T.type_alias do
|
97
|
+
T.any(
|
98
|
+
OpenAI::Webhooks::BatchFailedWebhookEvent::Data,
|
99
|
+
OpenAI::Internal::AnyHash
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
103
|
+
# The unique ID of the batch API request.
|
104
|
+
sig { returns(String) }
|
105
|
+
attr_accessor :id
|
106
|
+
|
107
|
+
# Event data payload.
|
108
|
+
sig { params(id: String).returns(T.attached_class) }
|
109
|
+
def self.new(
|
110
|
+
# The unique ID of the batch API request.
|
111
|
+
id:
|
112
|
+
)
|
113
|
+
end
|
114
|
+
|
115
|
+
sig { override.returns({ id: String }) }
|
116
|
+
def to_hash
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# The object of the event. Always `event`.
|
121
|
+
module Object
|
122
|
+
extend OpenAI::Internal::Type::Enum
|
123
|
+
|
124
|
+
TaggedSymbol =
|
125
|
+
T.type_alias do
|
126
|
+
T.all(Symbol, OpenAI::Webhooks::BatchFailedWebhookEvent::Object)
|
127
|
+
end
|
128
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
129
|
+
|
130
|
+
EVENT =
|
131
|
+
T.let(
|
132
|
+
:event,
|
133
|
+
OpenAI::Webhooks::BatchFailedWebhookEvent::Object::TaggedSymbol
|
134
|
+
)
|
135
|
+
|
136
|
+
sig do
|
137
|
+
override.returns(
|
138
|
+
T::Array[
|
139
|
+
OpenAI::Webhooks::BatchFailedWebhookEvent::Object::TaggedSymbol
|
140
|
+
]
|
141
|
+
)
|
142
|
+
end
|
143
|
+
def self.values
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|