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