openai 0.9.0 → 0.10.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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/openai/errors.rb +22 -0
  5. data/lib/openai/internal/type/array_of.rb +6 -1
  6. data/lib/openai/internal/type/base_model.rb +76 -24
  7. data/lib/openai/internal/type/boolean.rb +7 -1
  8. data/lib/openai/internal/type/converter.rb +42 -34
  9. data/lib/openai/internal/type/enum.rb +10 -2
  10. data/lib/openai/internal/type/file_input.rb +6 -1
  11. data/lib/openai/internal/type/hash_of.rb +6 -1
  12. data/lib/openai/internal/type/union.rb +12 -7
  13. data/lib/openai/internal/type/unknown.rb +7 -1
  14. data/lib/openai/models/audio/speech_create_params.rb +23 -2
  15. data/lib/openai/models/audio/transcription.rb +118 -1
  16. data/lib/openai/models/audio/transcription_text_done_event.rb +80 -1
  17. data/lib/openai/models/audio/transcription_verbose.rb +31 -1
  18. data/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rb +60 -25
  19. data/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rb +17 -8
  20. data/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rb +14 -10
  21. data/lib/openai/models/responses/response_code_interpreter_call_completed_event.rb +11 -10
  22. data/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rb +11 -10
  23. data/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rb +11 -10
  24. data/lib/openai/models/responses/response_code_interpreter_tool_call.rb +49 -78
  25. data/lib/openai/models/responses/response_create_params.rb +29 -29
  26. data/lib/openai/models/responses/response_output_text.rb +18 -2
  27. data/lib/openai/models/responses/response_stream_event.rb +2 -2
  28. data/lib/openai/resources/audio/speech.rb +3 -1
  29. data/lib/openai/resources/chat/completions.rb +8 -0
  30. data/lib/openai/resources/fine_tuning/checkpoints/permissions.rb +1 -2
  31. data/lib/openai/resources/responses.rb +12 -12
  32. data/lib/openai/version.rb +1 -1
  33. data/rbi/openai/errors.rbi +16 -0
  34. data/rbi/openai/internal/type/boolean.rbi +2 -0
  35. data/rbi/openai/internal/type/converter.rbi +15 -15
  36. data/rbi/openai/internal/type/union.rbi +5 -0
  37. data/rbi/openai/internal/type/unknown.rbi +2 -0
  38. data/rbi/openai/models/audio/speech_create_params.rbi +59 -2
  39. data/rbi/openai/models/audio/transcription.rbi +213 -3
  40. data/rbi/openai/models/audio/transcription_text_done_event.rbi +146 -1
  41. data/rbi/openai/models/audio/transcription_verbose.rbi +47 -0
  42. data/rbi/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi +95 -26
  43. data/rbi/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi +17 -7
  44. data/rbi/openai/models/responses/response_code_interpreter_call_code_done_event.rbi +13 -5
  45. data/rbi/openai/models/responses/response_code_interpreter_call_completed_event.rbi +13 -21
  46. data/rbi/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi +13 -21
  47. data/rbi/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi +13 -21
  48. data/rbi/openai/models/responses/response_code_interpreter_tool_call.rbi +83 -125
  49. data/rbi/openai/models/responses/response_create_params.rbi +83 -60
  50. data/rbi/openai/models/responses/response_output_text.rbi +26 -4
  51. data/rbi/openai/resources/audio/speech.rbi +6 -1
  52. data/rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi +1 -3
  53. data/rbi/openai/resources/responses.rbi +46 -46
  54. data/sig/openai/errors.rbs +9 -0
  55. data/sig/openai/internal/type/converter.rbs +7 -1
  56. data/sig/openai/models/audio/speech_create_params.rbs +21 -1
  57. data/sig/openai/models/audio/transcription.rbs +95 -3
  58. data/sig/openai/models/audio/transcription_text_done_event.rbs +72 -2
  59. data/sig/openai/models/audio/transcription_verbose.rbs +21 -0
  60. data/sig/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbs +53 -16
  61. data/sig/openai/models/responses/response_code_interpreter_call_code_delta_event.rbs +5 -0
  62. data/sig/openai/models/responses/response_code_interpreter_call_code_done_event.rbs +5 -0
  63. data/sig/openai/models/responses/response_code_interpreter_call_completed_event.rbs +4 -4
  64. data/sig/openai/models/responses/response_code_interpreter_call_in_progress_event.rbs +4 -4
  65. data/sig/openai/models/responses/response_code_interpreter_call_interpreting_event.rbs +4 -4
  66. data/sig/openai/models/responses/response_code_interpreter_tool_call.rbs +31 -52
  67. data/sig/openai/models/responses/response_create_params.rbs +18 -10
  68. data/sig/openai/models/responses/response_output_text.rbs +15 -1
  69. data/sig/openai/resources/audio/speech.rbs +1 -0
  70. data/sig/openai/resources/fine_tuning/checkpoints/permissions.rbs +1 -1
  71. data/sig/openai/resources/responses.rbs +4 -4
  72. metadata +2 -2
@@ -18,7 +18,13 @@ module OpenAI
18
18
  # @return [Array<OpenAI::Models::Audio::Transcription::Logprob>, nil]
19
19
  optional :logprobs, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Audio::Transcription::Logprob] }
20
20
 
21
- # @!method initialize(text:, logprobs: nil)
21
+ # @!attribute usage
22
+ # Token usage statistics for the request.
23
+ #
24
+ # @return [OpenAI::Models::Audio::Transcription::Usage::Tokens, OpenAI::Models::Audio::Transcription::Usage::Duration, nil]
25
+ optional :usage, union: -> { OpenAI::Audio::Transcription::Usage }
26
+
27
+ # @!method initialize(text:, logprobs: nil, usage: nil)
22
28
  # Some parameter documentations has been truncated, see
23
29
  # {OpenAI::Models::Audio::Transcription} for more details.
24
30
  #
@@ -28,6 +34,8 @@ module OpenAI
28
34
  # @param text [String] The transcribed text.
29
35
  #
30
36
  # @param logprobs [Array<OpenAI::Models::Audio::Transcription::Logprob>] The log probabilities of the tokens in the transcription. Only returned with the
37
+ #
38
+ # @param usage [OpenAI::Models::Audio::Transcription::Usage::Tokens, OpenAI::Models::Audio::Transcription::Usage::Duration] Token usage statistics for the request.
31
39
 
32
40
  class Logprob < OpenAI::Internal::Type::BaseModel
33
41
  # @!attribute token
@@ -55,6 +63,115 @@ module OpenAI
55
63
  #
56
64
  # @param logprob [Float] The log probability of the token.
57
65
  end
66
+
67
+ # Token usage statistics for the request.
68
+ #
69
+ # @see OpenAI::Models::Audio::Transcription#usage
70
+ module Usage
71
+ extend OpenAI::Internal::Type::Union
72
+
73
+ discriminator :type
74
+
75
+ # Usage statistics for models billed by token usage.
76
+ variant :tokens, -> { OpenAI::Audio::Transcription::Usage::Tokens }
77
+
78
+ # Usage statistics for models billed by audio input duration.
79
+ variant :duration, -> { OpenAI::Audio::Transcription::Usage::Duration }
80
+
81
+ class Tokens < OpenAI::Internal::Type::BaseModel
82
+ # @!attribute input_tokens
83
+ # Number of input tokens billed for this request.
84
+ #
85
+ # @return [Integer]
86
+ required :input_tokens, Integer
87
+
88
+ # @!attribute output_tokens
89
+ # Number of output tokens generated.
90
+ #
91
+ # @return [Integer]
92
+ required :output_tokens, Integer
93
+
94
+ # @!attribute total_tokens
95
+ # Total number of tokens used (input + output).
96
+ #
97
+ # @return [Integer]
98
+ required :total_tokens, Integer
99
+
100
+ # @!attribute type
101
+ # The type of the usage object. Always `tokens` for this variant.
102
+ #
103
+ # @return [Symbol, :tokens]
104
+ required :type, const: :tokens
105
+
106
+ # @!attribute input_token_details
107
+ # Details about the input tokens billed for this request.
108
+ #
109
+ # @return [OpenAI::Models::Audio::Transcription::Usage::Tokens::InputTokenDetails, nil]
110
+ optional :input_token_details,
111
+ -> {
112
+ OpenAI::Audio::Transcription::Usage::Tokens::InputTokenDetails
113
+ }
114
+
115
+ # @!method initialize(input_tokens:, output_tokens:, total_tokens:, input_token_details: nil, type: :tokens)
116
+ # Usage statistics for models billed by token usage.
117
+ #
118
+ # @param input_tokens [Integer] Number of input tokens billed for this request.
119
+ #
120
+ # @param output_tokens [Integer] Number of output tokens generated.
121
+ #
122
+ # @param total_tokens [Integer] Total number of tokens used (input + output).
123
+ #
124
+ # @param input_token_details [OpenAI::Models::Audio::Transcription::Usage::Tokens::InputTokenDetails] Details about the input tokens billed for this request.
125
+ #
126
+ # @param type [Symbol, :tokens] The type of the usage object. Always `tokens` for this variant.
127
+
128
+ # @see OpenAI::Models::Audio::Transcription::Usage::Tokens#input_token_details
129
+ class InputTokenDetails < OpenAI::Internal::Type::BaseModel
130
+ # @!attribute audio_tokens
131
+ # Number of audio tokens billed for this request.
132
+ #
133
+ # @return [Integer, nil]
134
+ optional :audio_tokens, Integer
135
+
136
+ # @!attribute text_tokens
137
+ # Number of text tokens billed for this request.
138
+ #
139
+ # @return [Integer, nil]
140
+ optional :text_tokens, Integer
141
+
142
+ # @!method initialize(audio_tokens: nil, text_tokens: nil)
143
+ # Details about the input tokens billed for this request.
144
+ #
145
+ # @param audio_tokens [Integer] Number of audio tokens billed for this request.
146
+ #
147
+ # @param text_tokens [Integer] Number of text tokens billed for this request.
148
+ end
149
+ end
150
+
151
+ class Duration < OpenAI::Internal::Type::BaseModel
152
+ # @!attribute duration
153
+ # Duration of the input audio in seconds.
154
+ #
155
+ # @return [Float]
156
+ required :duration, Float
157
+
158
+ # @!attribute type
159
+ # The type of the usage object. Always `duration` for this variant.
160
+ #
161
+ # @return [Symbol, :duration]
162
+ required :type, const: :duration
163
+
164
+ # @!method initialize(duration:, type: :duration)
165
+ # Usage statistics for models billed by audio input duration.
166
+ #
167
+ # @param duration [Float] Duration of the input audio in seconds.
168
+ #
169
+ # @param type [Symbol, :duration] The type of the usage object. Always `duration` for this variant.
170
+ end
171
+
172
+ # @!method self.variants
173
+ # @return [Array(OpenAI::Models::Audio::Transcription::Usage::Tokens, OpenAI::Models::Audio::Transcription::Usage::Duration)]
174
+ end
58
175
  end
59
176
  end
60
177
  end
@@ -26,7 +26,13 @@ module OpenAI
26
26
  optional :logprobs,
27
27
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Audio::TranscriptionTextDoneEvent::Logprob] }
28
28
 
29
- # @!method initialize(text:, logprobs: nil, type: :"transcript.text.done")
29
+ # @!attribute usage
30
+ # Usage statistics for models billed by token usage.
31
+ #
32
+ # @return [OpenAI::Models::Audio::TranscriptionTextDoneEvent::Usage, nil]
33
+ optional :usage, -> { OpenAI::Audio::TranscriptionTextDoneEvent::Usage }
34
+
35
+ # @!method initialize(text:, logprobs: nil, usage: nil, type: :"transcript.text.done")
30
36
  # Some parameter documentations has been truncated, see
31
37
  # {OpenAI::Models::Audio::TranscriptionTextDoneEvent} for more details.
32
38
  #
@@ -39,6 +45,8 @@ module OpenAI
39
45
  #
40
46
  # @param logprobs [Array<OpenAI::Models::Audio::TranscriptionTextDoneEvent::Logprob>] The log probabilities of the individual tokens in the transcription. Only includ
41
47
  #
48
+ # @param usage [OpenAI::Models::Audio::TranscriptionTextDoneEvent::Usage] Usage statistics for models billed by token usage.
49
+ #
42
50
  # @param type [Symbol, :"transcript.text.done"] The type of the event. Always `transcript.text.done`.
43
51
 
44
52
  class Logprob < OpenAI::Internal::Type::BaseModel
@@ -70,6 +78,77 @@ module OpenAI
70
78
  #
71
79
  # @param logprob [Float] The log probability of the token.
72
80
  end
81
+
82
+ # @see OpenAI::Models::Audio::TranscriptionTextDoneEvent#usage
83
+ class Usage < OpenAI::Internal::Type::BaseModel
84
+ # @!attribute input_tokens
85
+ # Number of input tokens billed for this request.
86
+ #
87
+ # @return [Integer]
88
+ required :input_tokens, Integer
89
+
90
+ # @!attribute output_tokens
91
+ # Number of output tokens generated.
92
+ #
93
+ # @return [Integer]
94
+ required :output_tokens, Integer
95
+
96
+ # @!attribute total_tokens
97
+ # Total number of tokens used (input + output).
98
+ #
99
+ # @return [Integer]
100
+ required :total_tokens, Integer
101
+
102
+ # @!attribute type
103
+ # The type of the usage object. Always `tokens` for this variant.
104
+ #
105
+ # @return [Symbol, :tokens]
106
+ required :type, const: :tokens
107
+
108
+ # @!attribute input_token_details
109
+ # Details about the input tokens billed for this request.
110
+ #
111
+ # @return [OpenAI::Models::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails, nil]
112
+ optional :input_token_details,
113
+ -> {
114
+ OpenAI::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails
115
+ }
116
+
117
+ # @!method initialize(input_tokens:, output_tokens:, total_tokens:, input_token_details: nil, type: :tokens)
118
+ # Usage statistics for models billed by token usage.
119
+ #
120
+ # @param input_tokens [Integer] Number of input tokens billed for this request.
121
+ #
122
+ # @param output_tokens [Integer] Number of output tokens generated.
123
+ #
124
+ # @param total_tokens [Integer] Total number of tokens used (input + output).
125
+ #
126
+ # @param input_token_details [OpenAI::Models::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails] Details about the input tokens billed for this request.
127
+ #
128
+ # @param type [Symbol, :tokens] The type of the usage object. Always `tokens` for this variant.
129
+
130
+ # @see OpenAI::Models::Audio::TranscriptionTextDoneEvent::Usage#input_token_details
131
+ class InputTokenDetails < OpenAI::Internal::Type::BaseModel
132
+ # @!attribute audio_tokens
133
+ # Number of audio tokens billed for this request.
134
+ #
135
+ # @return [Integer, nil]
136
+ optional :audio_tokens, Integer
137
+
138
+ # @!attribute text_tokens
139
+ # Number of text tokens billed for this request.
140
+ #
141
+ # @return [Integer, nil]
142
+ optional :text_tokens, Integer
143
+
144
+ # @!method initialize(audio_tokens: nil, text_tokens: nil)
145
+ # Details about the input tokens billed for this request.
146
+ #
147
+ # @param audio_tokens [Integer] Number of audio tokens billed for this request.
148
+ #
149
+ # @param text_tokens [Integer] Number of text tokens billed for this request.
150
+ end
151
+ end
73
152
  end
74
153
  end
75
154
  end
@@ -28,13 +28,19 @@ module OpenAI
28
28
  # @return [Array<OpenAI::Models::Audio::TranscriptionSegment>, nil]
29
29
  optional :segments, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Audio::TranscriptionSegment] }
30
30
 
31
+ # @!attribute usage
32
+ # Usage statistics for models billed by audio input duration.
33
+ #
34
+ # @return [OpenAI::Models::Audio::TranscriptionVerbose::Usage, nil]
35
+ optional :usage, -> { OpenAI::Audio::TranscriptionVerbose::Usage }
36
+
31
37
  # @!attribute words
32
38
  # Extracted words and their corresponding timestamps.
33
39
  #
34
40
  # @return [Array<OpenAI::Models::Audio::TranscriptionWord>, nil]
35
41
  optional :words, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Audio::TranscriptionWord] }
36
42
 
37
- # @!method initialize(duration:, language:, text:, segments: nil, words: nil)
43
+ # @!method initialize(duration:, language:, text:, segments: nil, usage: nil, words: nil)
38
44
  # Represents a verbose json transcription response returned by model, based on the
39
45
  # provided input.
40
46
  #
@@ -46,7 +52,31 @@ module OpenAI
46
52
  #
47
53
  # @param segments [Array<OpenAI::Models::Audio::TranscriptionSegment>] Segments of the transcribed text and their corresponding details.
48
54
  #
55
+ # @param usage [OpenAI::Models::Audio::TranscriptionVerbose::Usage] Usage statistics for models billed by audio input duration.
56
+ #
49
57
  # @param words [Array<OpenAI::Models::Audio::TranscriptionWord>] Extracted words and their corresponding timestamps.
58
+
59
+ # @see OpenAI::Models::Audio::TranscriptionVerbose#usage
60
+ class Usage < OpenAI::Internal::Type::BaseModel
61
+ # @!attribute duration
62
+ # Duration of the input audio in seconds.
63
+ #
64
+ # @return [Float]
65
+ required :duration, Float
66
+
67
+ # @!attribute type
68
+ # The type of the usage object. Always `duration` for this variant.
69
+ #
70
+ # @return [Symbol, :duration]
71
+ required :type, const: :duration
72
+
73
+ # @!method initialize(duration:, type: :duration)
74
+ # Usage statistics for models billed by audio input duration.
75
+ #
76
+ # @param duration [Float] Duration of the input audio in seconds.
77
+ #
78
+ # @param type [Symbol, :duration] The type of the usage object. Always `duration` for this variant.
79
+ end
50
80
  end
51
81
  end
52
82
  end
@@ -6,41 +6,76 @@ module OpenAI
6
6
  module Checkpoints
7
7
  # @see OpenAI::Resources::FineTuning::Checkpoints::Permissions#retrieve
8
8
  class PermissionRetrieveResponse < OpenAI::Internal::Type::BaseModel
9
- # @!attribute id
10
- # The permission identifier, which can be referenced in the API endpoints.
9
+ # @!attribute data
11
10
  #
12
- # @return [String]
13
- required :id, String
11
+ # @return [Array<OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse::Data>]
12
+ required :data,
13
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse::Data] }
14
14
 
15
- # @!attribute created_at
16
- # The Unix timestamp (in seconds) for when the permission was created.
15
+ # @!attribute has_more
17
16
  #
18
- # @return [Integer]
19
- required :created_at, Integer
17
+ # @return [Boolean]
18
+ required :has_more, OpenAI::Internal::Type::Boolean
20
19
 
21
20
  # @!attribute object
22
- # The object type, which is always "checkpoint.permission".
23
21
  #
24
- # @return [Symbol, :"checkpoint.permission"]
25
- required :object, const: :"checkpoint.permission"
22
+ # @return [Symbol, :list]
23
+ required :object, const: :list
26
24
 
27
- # @!attribute project_id
28
- # The project identifier that the permission is for.
25
+ # @!attribute first_id
29
26
  #
30
- # @return [String]
31
- required :project_id, String
27
+ # @return [String, nil]
28
+ optional :first_id, String, nil?: true
32
29
 
33
- # @!method initialize(id:, created_at:, project_id:, object: :"checkpoint.permission")
34
- # The `checkpoint.permission` object represents a permission for a fine-tuned
35
- # model checkpoint.
30
+ # @!attribute last_id
36
31
  #
37
- # @param id [String] The permission identifier, which can be referenced in the API endpoints.
38
- #
39
- # @param created_at [Integer] The Unix timestamp (in seconds) for when the permission was created.
40
- #
41
- # @param project_id [String] The project identifier that the permission is for.
42
- #
43
- # @param object [Symbol, :"checkpoint.permission"] The object type, which is always "checkpoint.permission".
32
+ # @return [String, nil]
33
+ optional :last_id, String, nil?: true
34
+
35
+ # @!method initialize(data:, has_more:, first_id: nil, last_id: nil, object: :list)
36
+ # @param data [Array<OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse::Data>]
37
+ # @param has_more [Boolean]
38
+ # @param first_id [String, nil]
39
+ # @param last_id [String, nil]
40
+ # @param object [Symbol, :list]
41
+
42
+ class Data < OpenAI::Internal::Type::BaseModel
43
+ # @!attribute id
44
+ # The permission identifier, which can be referenced in the API endpoints.
45
+ #
46
+ # @return [String]
47
+ required :id, String
48
+
49
+ # @!attribute created_at
50
+ # The Unix timestamp (in seconds) for when the permission was created.
51
+ #
52
+ # @return [Integer]
53
+ required :created_at, Integer
54
+
55
+ # @!attribute object
56
+ # The object type, which is always "checkpoint.permission".
57
+ #
58
+ # @return [Symbol, :"checkpoint.permission"]
59
+ required :object, const: :"checkpoint.permission"
60
+
61
+ # @!attribute project_id
62
+ # The project identifier that the permission is for.
63
+ #
64
+ # @return [String]
65
+ required :project_id, String
66
+
67
+ # @!method initialize(id:, created_at:, project_id:, object: :"checkpoint.permission")
68
+ # The `checkpoint.permission` object represents a permission for a fine-tuned
69
+ # model checkpoint.
70
+ #
71
+ # @param id [String] The permission identifier, which can be referenced in the API endpoints.
72
+ #
73
+ # @param created_at [Integer] The Unix timestamp (in seconds) for when the permission was created.
74
+ #
75
+ # @param project_id [String] The project identifier that the permission is for.
76
+ #
77
+ # @param object [Symbol, :"checkpoint.permission"] The object type, which is always "checkpoint.permission".
78
+ end
44
79
  end
45
80
  end
46
81
  end
@@ -5,19 +5,26 @@ module OpenAI
5
5
  module Responses
6
6
  class ResponseCodeInterpreterCallCodeDeltaEvent < OpenAI::Internal::Type::BaseModel
7
7
  # @!attribute delta
8
- # The partial code snippet added by the code interpreter.
8
+ # The partial code snippet being streamed by the code interpreter.
9
9
  #
10
10
  # @return [String]
11
11
  required :delta, String
12
12
 
13
+ # @!attribute item_id
14
+ # The unique identifier of the code interpreter tool call item.
15
+ #
16
+ # @return [String]
17
+ required :item_id, String
18
+
13
19
  # @!attribute output_index
14
- # The index of the output item that the code interpreter call is in progress.
20
+ # The index of the output item in the response for which the code is being
21
+ # streamed.
15
22
  #
16
23
  # @return [Integer]
17
24
  required :output_index, Integer
18
25
 
19
26
  # @!attribute sequence_number
20
- # The sequence number of this event.
27
+ # The sequence number of this event, used to order streaming events.
21
28
  #
22
29
  # @return [Integer]
23
30
  required :sequence_number, Integer
@@ -28,18 +35,20 @@ module OpenAI
28
35
  # @return [Symbol, :"response.code_interpreter_call_code.delta"]
29
36
  required :type, const: :"response.code_interpreter_call_code.delta"
30
37
 
31
- # @!method initialize(delta:, output_index:, sequence_number:, type: :"response.code_interpreter_call_code.delta")
38
+ # @!method initialize(delta:, item_id:, output_index:, sequence_number:, type: :"response.code_interpreter_call_code.delta")
32
39
  # Some parameter documentations has been truncated, see
33
40
  # {OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDeltaEvent} for more
34
41
  # details.
35
42
  #
36
- # Emitted when a partial code snippet is added by the code interpreter.
43
+ # Emitted when a partial code snippet is streamed by the code interpreter.
44
+ #
45
+ # @param delta [String] The partial code snippet being streamed by the code interpreter.
37
46
  #
38
- # @param delta [String] The partial code snippet added by the code interpreter.
47
+ # @param item_id [String] The unique identifier of the code interpreter tool call item.
39
48
  #
40
- # @param output_index [Integer] The index of the output item that the code interpreter call is in progress.
49
+ # @param output_index [Integer] The index of the output item in the response for which the code is being streame
41
50
  #
42
- # @param sequence_number [Integer] The sequence number of this event.
51
+ # @param sequence_number [Integer] The sequence number of this event, used to order streaming events.
43
52
  #
44
53
  # @param type [Symbol, :"response.code_interpreter_call_code.delta"] The type of the event. Always `response.code_interpreter_call_code.delta`.
45
54
  end
@@ -10,14 +10,20 @@ module OpenAI
10
10
  # @return [String]
11
11
  required :code, String
12
12
 
13
+ # @!attribute item_id
14
+ # The unique identifier of the code interpreter tool call item.
15
+ #
16
+ # @return [String]
17
+ required :item_id, String
18
+
13
19
  # @!attribute output_index
14
- # The index of the output item that the code interpreter call is in progress.
20
+ # The index of the output item in the response for which the code is finalized.
15
21
  #
16
22
  # @return [Integer]
17
23
  required :output_index, Integer
18
24
 
19
25
  # @!attribute sequence_number
20
- # The sequence number of this event.
26
+ # The sequence number of this event, used to order streaming events.
21
27
  #
22
28
  # @return [Integer]
23
29
  required :sequence_number, Integer
@@ -28,18 +34,16 @@ module OpenAI
28
34
  # @return [Symbol, :"response.code_interpreter_call_code.done"]
29
35
  required :type, const: :"response.code_interpreter_call_code.done"
30
36
 
31
- # @!method initialize(code:, output_index:, sequence_number:, type: :"response.code_interpreter_call_code.done")
32
- # Some parameter documentations has been truncated, see
33
- # {OpenAI::Models::Responses::ResponseCodeInterpreterCallCodeDoneEvent} for more
34
- # details.
35
- #
36
- # Emitted when code snippet output is finalized by the code interpreter.
37
+ # @!method initialize(code:, item_id:, output_index:, sequence_number:, type: :"response.code_interpreter_call_code.done")
38
+ # Emitted when the code snippet is finalized by the code interpreter.
37
39
  #
38
40
  # @param code [String] The final code snippet output by the code interpreter.
39
41
  #
40
- # @param output_index [Integer] The index of the output item that the code interpreter call is in progress.
42
+ # @param item_id [String] The unique identifier of the code interpreter tool call item.
43
+ #
44
+ # @param output_index [Integer] The index of the output item in the response for which the code is finalized.
41
45
  #
42
- # @param sequence_number [Integer] The sequence number of this event.
46
+ # @param sequence_number [Integer] The sequence number of this event, used to order streaming events.
43
47
  #
44
48
  # @param type [Symbol, :"response.code_interpreter_call_code.done"] The type of the event. Always `response.code_interpreter_call_code.done`.
45
49
  end
@@ -4,20 +4,21 @@ module OpenAI
4
4
  module Models
5
5
  module Responses
6
6
  class ResponseCodeInterpreterCallCompletedEvent < OpenAI::Internal::Type::BaseModel
7
- # @!attribute code_interpreter_call
8
- # A tool call to run code.
7
+ # @!attribute item_id
8
+ # The unique identifier of the code interpreter tool call item.
9
9
  #
10
- # @return [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall]
11
- required :code_interpreter_call, -> { OpenAI::Responses::ResponseCodeInterpreterToolCall }
10
+ # @return [String]
11
+ required :item_id, String
12
12
 
13
13
  # @!attribute output_index
14
- # The index of the output item that the code interpreter call is in progress.
14
+ # The index of the output item in the response for which the code interpreter call
15
+ # is completed.
15
16
  #
16
17
  # @return [Integer]
17
18
  required :output_index, Integer
18
19
 
19
20
  # @!attribute sequence_number
20
- # The sequence number of this event.
21
+ # The sequence number of this event, used to order streaming events.
21
22
  #
22
23
  # @return [Integer]
23
24
  required :sequence_number, Integer
@@ -28,18 +29,18 @@ module OpenAI
28
29
  # @return [Symbol, :"response.code_interpreter_call.completed"]
29
30
  required :type, const: :"response.code_interpreter_call.completed"
30
31
 
31
- # @!method initialize(code_interpreter_call:, output_index:, sequence_number:, type: :"response.code_interpreter_call.completed")
32
+ # @!method initialize(item_id:, output_index:, sequence_number:, type: :"response.code_interpreter_call.completed")
32
33
  # Some parameter documentations has been truncated, see
33
34
  # {OpenAI::Models::Responses::ResponseCodeInterpreterCallCompletedEvent} for more
34
35
  # details.
35
36
  #
36
37
  # Emitted when the code interpreter call is completed.
37
38
  #
38
- # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] A tool call to run code.
39
+ # @param item_id [String] The unique identifier of the code interpreter tool call item.
39
40
  #
40
- # @param output_index [Integer] The index of the output item that the code interpreter call is in progress.
41
+ # @param output_index [Integer] The index of the output item in the response for which the code interpreter call
41
42
  #
42
- # @param sequence_number [Integer] The sequence number of this event.
43
+ # @param sequence_number [Integer] The sequence number of this event, used to order streaming events.
43
44
  #
44
45
  # @param type [Symbol, :"response.code_interpreter_call.completed"] The type of the event. Always `response.code_interpreter_call.completed`.
45
46
  end
@@ -4,20 +4,21 @@ module OpenAI
4
4
  module Models
5
5
  module Responses
6
6
  class ResponseCodeInterpreterCallInProgressEvent < OpenAI::Internal::Type::BaseModel
7
- # @!attribute code_interpreter_call
8
- # A tool call to run code.
7
+ # @!attribute item_id
8
+ # The unique identifier of the code interpreter tool call item.
9
9
  #
10
- # @return [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall]
11
- required :code_interpreter_call, -> { OpenAI::Responses::ResponseCodeInterpreterToolCall }
10
+ # @return [String]
11
+ required :item_id, String
12
12
 
13
13
  # @!attribute output_index
14
- # The index of the output item that the code interpreter call is in progress.
14
+ # The index of the output item in the response for which the code interpreter call
15
+ # is in progress.
15
16
  #
16
17
  # @return [Integer]
17
18
  required :output_index, Integer
18
19
 
19
20
  # @!attribute sequence_number
20
- # The sequence number of this event.
21
+ # The sequence number of this event, used to order streaming events.
21
22
  #
22
23
  # @return [Integer]
23
24
  required :sequence_number, Integer
@@ -28,18 +29,18 @@ module OpenAI
28
29
  # @return [Symbol, :"response.code_interpreter_call.in_progress"]
29
30
  required :type, const: :"response.code_interpreter_call.in_progress"
30
31
 
31
- # @!method initialize(code_interpreter_call:, output_index:, sequence_number:, type: :"response.code_interpreter_call.in_progress")
32
+ # @!method initialize(item_id:, output_index:, sequence_number:, type: :"response.code_interpreter_call.in_progress")
32
33
  # Some parameter documentations has been truncated, see
33
34
  # {OpenAI::Models::Responses::ResponseCodeInterpreterCallInProgressEvent} for more
34
35
  # details.
35
36
  #
36
37
  # Emitted when a code interpreter call is in progress.
37
38
  #
38
- # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] A tool call to run code.
39
+ # @param item_id [String] The unique identifier of the code interpreter tool call item.
39
40
  #
40
- # @param output_index [Integer] The index of the output item that the code interpreter call is in progress.
41
+ # @param output_index [Integer] The index of the output item in the response for which the code interpreter call
41
42
  #
42
- # @param sequence_number [Integer] The sequence number of this event.
43
+ # @param sequence_number [Integer] The sequence number of this event, used to order streaming events.
43
44
  #
44
45
  # @param type [Symbol, :"response.code_interpreter_call.in_progress"] The type of the event. Always `response.code_interpreter_call.in_progress`.
45
46
  end
@@ -4,20 +4,21 @@ module OpenAI
4
4
  module Models
5
5
  module Responses
6
6
  class ResponseCodeInterpreterCallInterpretingEvent < OpenAI::Internal::Type::BaseModel
7
- # @!attribute code_interpreter_call
8
- # A tool call to run code.
7
+ # @!attribute item_id
8
+ # The unique identifier of the code interpreter tool call item.
9
9
  #
10
- # @return [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall]
11
- required :code_interpreter_call, -> { OpenAI::Responses::ResponseCodeInterpreterToolCall }
10
+ # @return [String]
11
+ required :item_id, String
12
12
 
13
13
  # @!attribute output_index
14
- # The index of the output item that the code interpreter call is in progress.
14
+ # The index of the output item in the response for which the code interpreter is
15
+ # interpreting code.
15
16
  #
16
17
  # @return [Integer]
17
18
  required :output_index, Integer
18
19
 
19
20
  # @!attribute sequence_number
20
- # The sequence number of this event.
21
+ # The sequence number of this event, used to order streaming events.
21
22
  #
22
23
  # @return [Integer]
23
24
  required :sequence_number, Integer
@@ -28,18 +29,18 @@ module OpenAI
28
29
  # @return [Symbol, :"response.code_interpreter_call.interpreting"]
29
30
  required :type, const: :"response.code_interpreter_call.interpreting"
30
31
 
31
- # @!method initialize(code_interpreter_call:, output_index:, sequence_number:, type: :"response.code_interpreter_call.interpreting")
32
+ # @!method initialize(item_id:, output_index:, sequence_number:, type: :"response.code_interpreter_call.interpreting")
32
33
  # Some parameter documentations has been truncated, see
33
34
  # {OpenAI::Models::Responses::ResponseCodeInterpreterCallInterpretingEvent} for
34
35
  # more details.
35
36
  #
36
37
  # Emitted when the code interpreter is actively interpreting the code snippet.
37
38
  #
38
- # @param code_interpreter_call [OpenAI::Models::Responses::ResponseCodeInterpreterToolCall] A tool call to run code.
39
+ # @param item_id [String] The unique identifier of the code interpreter tool call item.
39
40
  #
40
- # @param output_index [Integer] The index of the output item that the code interpreter call is in progress.
41
+ # @param output_index [Integer] The index of the output item in the response for which the code interpreter is i
41
42
  #
42
- # @param sequence_number [Integer] The sequence number of this event.
43
+ # @param sequence_number [Integer] The sequence number of this event, used to order streaming events.
43
44
  #
44
45
  # @param type [Symbol, :"response.code_interpreter_call.interpreting"] The type of the event. Always `response.code_interpreter_call.interpreting`.
45
46
  end