openai 0.42.0 → 0.45.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 +57 -0
- data/README.md +12 -18
- data/lib/openai/internal/transport/pooled_net_requester.rb +1 -1
- data/lib/openai/models/audio/speech_create_params.rb +9 -7
- data/lib/openai/models/beta/assistant.rb +2 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +7 -5
- data/lib/openai/models/conversations/conversation_item.rb +1 -1
- data/lib/openai/models/conversations/message.rb +1 -1
- data/lib/openai/models/file_create_params.rb +9 -5
- data/lib/openai/models/file_purpose.rb +8 -4
- data/lib/openai/models/realtime/conversation_item_create_event.rb +9 -5
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -9
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -9
- data/lib/openai/models/realtime/response_function_call_arguments_done_event.rb +9 -1
- data/lib/openai/models/responses/input_token_count_params.rb +4 -7
- data/lib/openai/models/responses/response.rb +17 -8
- data/lib/openai/models/responses/response_compact_params.rb +1 -0
- data/lib/openai/models/responses/response_compaction_item.rb +4 -2
- data/lib/openai/models/responses/response_compaction_item_param.rb +2 -1
- data/lib/openai/models/responses/response_computer_tool_call.rb +6 -6
- data/lib/openai/models/responses/response_function_call_output_item.rb +1 -1
- data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +35 -7
- data/lib/openai/models/responses/response_function_web_search.rb +26 -18
- data/lib/openai/models/responses/response_input_item.rb +28 -1
- data/lib/openai/models/responses/response_item.rb +1 -1
- data/lib/openai/models/responses/response_output_item.rb +1 -1
- data/lib/openai/models/responses/response_output_text.rb +1 -1
- data/lib/openai/models/responses/tool.rb +30 -2
- data/lib/openai/models/video_create_error.rb +7 -2
- data/lib/openai/resources/audio/speech.rb +1 -1
- data/lib/openai/resources/beta/assistants.rb +10 -0
- data/lib/openai/resources/files.rb +3 -3
- data/lib/openai/resources/images.rb +4 -2
- data/lib/openai/resources/responses/input_tokens.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/rbi/openai/models/audio/speech_create_params.rbi +12 -9
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +9 -6
- data/rbi/openai/models/conversations/message.rbi +1 -1
- data/rbi/openai/models/file_create_params.rbi +16 -8
- data/rbi/openai/models/file_purpose.rbi +8 -4
- data/rbi/openai/models/realtime/conversation_item_create_event.rbi +16 -8
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +12 -12
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +12 -12
- data/rbi/openai/models/realtime/response_function_call_arguments_done_event.rbi +8 -0
- data/rbi/openai/models/responses/input_token_count_params.rbi +3 -9
- data/rbi/openai/models/responses/response.rbi +18 -8
- data/rbi/openai/models/responses/response_compaction_item.rbi +4 -0
- data/rbi/openai/models/responses/response_compaction_item_param.rbi +2 -0
- data/rbi/openai/models/responses/response_function_call_output_item.rbi +1 -1
- data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +67 -2
- data/rbi/openai/models/responses/response_function_web_search.rbi +26 -11
- data/rbi/openai/models/responses/response_input_item.rbi +61 -1
- data/rbi/openai/models/responses/response_output_text.rbi +1 -1
- data/rbi/openai/models/responses/tool.rbi +68 -0
- data/rbi/openai/models/video_create_error.rbi +9 -1
- data/rbi/openai/resources/audio/speech.rbi +4 -3
- data/rbi/openai/resources/files.rbi +10 -6
- data/rbi/openai/resources/images.rbi +4 -2
- data/rbi/openai/resources/responses/input_tokens.rbi +1 -3
- data/sig/openai/models/realtime/response_function_call_arguments_done_event.rbs +5 -0
- data/sig/openai/models/responses/response.rbs +5 -0
- data/sig/openai/models/responses/response_function_shell_tool_call_output.rbs +17 -0
- data/sig/openai/models/responses/response_function_web_search.rbs +24 -8
- data/sig/openai/models/responses/response_input_item.rbs +19 -2
- data/sig/openai/models/responses/tool.rbs +24 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 10373778f29256c14ae2a86c73559f1666fead459817c6261b4960c64d0a8c6e
|
|
4
|
+
data.tar.gz: d923d898c5f7adcd2430cfa8baf05a7b76bb0b4450ed7a808e4cb85d5cb49b9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5131c4e4918e766e222df46cffd15582461fa8dd677a55ae2e6602c0283ed3c6a48682b562dbf1135573329fa295d4b4e2ac2bb52897b032dd5297c5ff85e191
|
|
7
|
+
data.tar.gz: c13000c1ad47d32f6c4fad58b2974f3dec4dfb58a751e34d4c76da1cb032391439fdc07f4f8a8052b1c8e7fe1dc181567c26acdacf65cb09b30376b8167598aa
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.45.0 (2026-02-04)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.44.0...v0.45.0](https://github.com/openai/openai-ruby/compare/v0.44.0...v0.45.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add shell_call_output status field ([b235617](https://github.com/openai/openai-ruby/commit/b2356174e90b573b98f16a3176a51cc2b4a108b4))
|
|
10
|
+
* **api:** image generation actions for responses; ResponseFunctionCallArgumentsDoneEvent.name ([da359de](https://github.com/openai/openai-ruby/commit/da359de522a5532b287094b04f625248687d08f3))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **client:** always add content-length to post body, even when empty ([b6faa94](https://github.com/openai/openai-ruby/commit/b6faa94ec4454515c576c067a584e2a62fa33666))
|
|
16
|
+
* **client:** undo change to web search Find action ([e10a7dd](https://github.com/openai/openai-ruby/commit/e10a7dd8f601a66b5b1e7c769623f51f9e191a9f))
|
|
17
|
+
* **client:** update type for `find_in_page` action ([dd727fa](https://github.com/openai/openai-ruby/commit/dd727fadbd82ae42181fae53582043809e4dd391))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* **client:** improve example values ([3c8e152](https://github.com/openai/openai-ruby/commit/3c8e1520fd7bea47442814fe2a4196c68f2062c7))
|
|
23
|
+
* **docs:** remove www prefix ([6ef56a3](https://github.com/openai/openai-ruby/commit/6ef56a36260ed01f4ea302ae69a73aed366e5e94))
|
|
24
|
+
|
|
25
|
+
## 0.44.0 (2026-01-27)
|
|
26
|
+
|
|
27
|
+
Full Changelog: [v0.43.0...v0.44.0](https://github.com/openai/openai-ruby/compare/v0.43.0...v0.44.0)
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **api:** api update ([407360e](https://github.com/openai/openai-ruby/commit/407360eb65bd70de1e4398e2b892624d0d674ea9))
|
|
32
|
+
* **api:** api updates ([d3b882e](https://github.com/openai/openai-ruby/commit/d3b882ec9547197583f8002395842cc861b08774))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* **api:** mark assistants as deprecated ([5baf7da](https://github.com/openai/openai-ruby/commit/5baf7dab0fecd0fb64720ce586377e9999d76b9e))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Chores
|
|
41
|
+
|
|
42
|
+
* **internal:** update `actions/checkout` version ([78251bd](https://github.com/openai/openai-ruby/commit/78251bd3cdaccc09f57feda8ee5b73cab03d6625))
|
|
43
|
+
|
|
44
|
+
## 0.43.0 (2026-01-09)
|
|
45
|
+
|
|
46
|
+
Full Changelog: [v0.42.0...v0.43.0](https://github.com/openai/openai-ruby/compare/v0.42.0...v0.43.0)
|
|
47
|
+
|
|
48
|
+
### Features
|
|
49
|
+
|
|
50
|
+
* **api:** add new Response completed_at prop ([c32e1c2](https://github.com/openai/openai-ruby/commit/c32e1c2a0a0ae6a9b7724e1c6d251ba14e8499e1))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Chores
|
|
54
|
+
|
|
55
|
+
* add ci tests for ruby 4 compatibility [#235](https://github.com/openai/openai-ruby/issues/235) ([#236](https://github.com/openai/openai-ruby/issues/236)) ([1aa0d7a](https://github.com/openai/openai-ruby/commit/1aa0d7abf5a4714fa28cfe7ee5aecefbe2c683d2))
|
|
56
|
+
* **internal:** codegen related update ([ef23de3](https://github.com/openai/openai-ruby/commit/ef23de347b5f541853a32a288cd02a54938793cf))
|
|
57
|
+
* **internal:** use different example values for some enums ([8b6c4ad](https://github.com/openai/openai-ruby/commit/8b6c4ade813244e8c65690c66fe09f2566dd3ff0))
|
|
58
|
+
* move `cgi` into dependencies for ruby 4 ([bd9c798](https://github.com/openai/openai-ruby/commit/bd9c798552a3d378ec943c7e07d6cf1334f72b1d))
|
|
59
|
+
|
|
3
60
|
## 0.42.0 (2025-12-19)
|
|
4
61
|
|
|
5
62
|
Full Changelog: [v0.41.0...v0.42.0](https://github.com/openai/openai-ruby/compare/v0.41.0...v0.42.0)
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
15
15
|
<!-- x-release-please-start-version -->
|
|
16
16
|
|
|
17
17
|
```ruby
|
|
18
|
-
gem "openai", "~> 0.
|
|
18
|
+
gem "openai", "~> 0.45.0"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -30,10 +30,7 @@ openai = OpenAI::Client.new(
|
|
|
30
30
|
api_key: ENV["OPENAI_API_KEY"] # This is the default and can be omitted
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
-
chat_completion = openai.chat.completions.create(
|
|
34
|
-
messages: [{role: "user", content: "Say this is a test"}],
|
|
35
|
-
model: :"gpt-5.2"
|
|
36
|
-
)
|
|
33
|
+
chat_completion = openai.chat.completions.create(messages: [{role: "user", content: "Say this is a test"}], model: "gpt-5.2")
|
|
37
34
|
|
|
38
35
|
puts(chat_completion)
|
|
39
36
|
```
|
|
@@ -45,7 +42,7 @@ We provide support for streaming responses using Server-Sent Events (SSE).
|
|
|
45
42
|
```ruby
|
|
46
43
|
stream = openai.responses.stream(
|
|
47
44
|
input: "Write a haiku about OpenAI.",
|
|
48
|
-
model:
|
|
45
|
+
model: "gpt-5.2"
|
|
49
46
|
)
|
|
50
47
|
|
|
51
48
|
stream.each do |event|
|
|
@@ -214,7 +211,7 @@ end
|
|
|
214
211
|
client = OpenAI::Client.new
|
|
215
212
|
|
|
216
213
|
response = client.responses.create(
|
|
217
|
-
model: "gpt-
|
|
214
|
+
model: "gpt-5.2",
|
|
218
215
|
input: [
|
|
219
216
|
{role: :system, content: "Extract the event information."},
|
|
220
217
|
{
|
|
@@ -250,7 +247,7 @@ To make the equivalent request using raw JSON schema format, you would do the fo
|
|
|
250
247
|
|
|
251
248
|
```ruby
|
|
252
249
|
response = client.responses.create(
|
|
253
|
-
model: "gpt-
|
|
250
|
+
model: "gpt-5.2",
|
|
254
251
|
input: [
|
|
255
252
|
{role: :system, content: "Extract the event information."},
|
|
256
253
|
{
|
|
@@ -298,7 +295,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
|
|
|
298
295
|
|
|
299
296
|
```ruby
|
|
300
297
|
begin
|
|
301
|
-
job = openai.fine_tuning.jobs.create(model:
|
|
298
|
+
job = openai.fine_tuning.jobs.create(model: "gpt-4o", training_file: "file-abc123")
|
|
302
299
|
rescue OpenAI::Errors::APIConnectionError => e
|
|
303
300
|
puts("The server could not be reached")
|
|
304
301
|
puts(e.cause) # an underlying Exception, likely raised within `net/http`
|
|
@@ -343,7 +340,7 @@ openai = OpenAI::Client.new(
|
|
|
343
340
|
# Or, configure per-request:
|
|
344
341
|
openai.chat.completions.create(
|
|
345
342
|
messages: [{role: "user", content: "How can I get the name of the current day in JavaScript?"}],
|
|
346
|
-
model:
|
|
343
|
+
model: "gpt-5.2",
|
|
347
344
|
request_options: {max_retries: 5}
|
|
348
345
|
)
|
|
349
346
|
```
|
|
@@ -361,7 +358,7 @@ openai = OpenAI::Client.new(
|
|
|
361
358
|
# Or, configure per-request:
|
|
362
359
|
openai.chat.completions.create(
|
|
363
360
|
messages: [{role: "user", content: "How can I list all files in a directory using Python?"}],
|
|
364
|
-
model:
|
|
361
|
+
model: "gpt-5.2",
|
|
365
362
|
request_options: {timeout: 5}
|
|
366
363
|
)
|
|
367
364
|
```
|
|
@@ -396,7 +393,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
|
|
|
396
393
|
chat_completion =
|
|
397
394
|
openai.chat.completions.create(
|
|
398
395
|
messages: [{role: "user", content: "How can I get the name of the current day in JavaScript?"}],
|
|
399
|
-
model:
|
|
396
|
+
model: "gpt-5.2",
|
|
400
397
|
request_options: {
|
|
401
398
|
extra_query: {my_query_parameter: value},
|
|
402
399
|
extra_body: {my_body_parameter: value},
|
|
@@ -444,7 +441,7 @@ You can provide typesafe request parameters like so:
|
|
|
444
441
|
```ruby
|
|
445
442
|
openai.chat.completions.create(
|
|
446
443
|
messages: [OpenAI::Chat::ChatCompletionUserMessageParam.new(content: "Say this is a test")],
|
|
447
|
-
model:
|
|
444
|
+
model: "gpt-5.2"
|
|
448
445
|
)
|
|
449
446
|
```
|
|
450
447
|
|
|
@@ -452,15 +449,12 @@ Or, equivalently:
|
|
|
452
449
|
|
|
453
450
|
```ruby
|
|
454
451
|
# Hashes work, but are not typesafe:
|
|
455
|
-
openai.chat.completions.create(
|
|
456
|
-
messages: [{role: "user", content: "Say this is a test"}],
|
|
457
|
-
model: :"gpt-5.2"
|
|
458
|
-
)
|
|
452
|
+
openai.chat.completions.create(messages: [{role: "user", content: "Say this is a test"}], model: "gpt-5.2")
|
|
459
453
|
|
|
460
454
|
# You can also splat a full Params class:
|
|
461
455
|
params = OpenAI::Chat::CompletionCreateParams.new(
|
|
462
456
|
messages: [OpenAI::Chat::ChatCompletionUserMessageParam.new(content: "Say this is a test")],
|
|
463
|
-
model:
|
|
457
|
+
model: "gpt-5.2"
|
|
464
458
|
)
|
|
465
459
|
openai.chat.completions.create(**params)
|
|
466
460
|
```
|
|
@@ -75,7 +75,7 @@ module OpenAI
|
|
|
75
75
|
|
|
76
76
|
case body
|
|
77
77
|
in nil
|
|
78
|
-
|
|
78
|
+
req["content-length"] ||= 0 unless req["transfer-encoding"]
|
|
79
79
|
in String
|
|
80
80
|
req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
|
|
81
81
|
req.body_stream = OpenAI::Internal::Util::ReadIOAdapter.new(body, &blk)
|
|
@@ -22,9 +22,10 @@ module OpenAI
|
|
|
22
22
|
required :model, union: -> { OpenAI::Audio::SpeechCreateParams::Model }
|
|
23
23
|
|
|
24
24
|
# @!attribute voice
|
|
25
|
-
# The voice to use when generating the audio. Supported voices are
|
|
26
|
-
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
|
|
27
|
-
# `verse`. Previews of the voices are available
|
|
25
|
+
# The voice to use when generating the audio. Supported built-in voices are
|
|
26
|
+
# `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
|
|
27
|
+
# `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
|
|
28
|
+
# in the
|
|
28
29
|
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
|
|
29
30
|
#
|
|
30
31
|
# @return [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice]
|
|
@@ -66,7 +67,7 @@ module OpenAI
|
|
|
66
67
|
#
|
|
67
68
|
# @param model [String, Symbol, OpenAI::Models::Audio::SpeechModel] One of the available [TTS models](https://platform.openai.com/docs/models#tts):
|
|
68
69
|
#
|
|
69
|
-
# @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported voices are `alloy
|
|
70
|
+
# @param voice [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice] The voice to use when generating the audio. Supported built-in voices are `alloy
|
|
70
71
|
#
|
|
71
72
|
# @param instructions [String] Control the voice of your generated audio with additional instructions. Does not
|
|
72
73
|
#
|
|
@@ -92,9 +93,10 @@ module OpenAI
|
|
|
92
93
|
# @return [Array(String, Symbol, OpenAI::Models::Audio::SpeechModel)]
|
|
93
94
|
end
|
|
94
95
|
|
|
95
|
-
# The voice to use when generating the audio. Supported voices are
|
|
96
|
-
# `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
|
|
97
|
-
# `verse`. Previews of the voices are available
|
|
96
|
+
# The voice to use when generating the audio. Supported built-in voices are
|
|
97
|
+
# `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
|
|
98
|
+
# `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
|
|
99
|
+
# in the
|
|
98
100
|
# [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
|
|
99
101
|
module Voice
|
|
100
102
|
extend OpenAI::Internal::Type::Union
|
|
@@ -12,8 +12,9 @@ module OpenAI
|
|
|
12
12
|
required :format_, enum: -> { OpenAI::Chat::ChatCompletionAudioParam::Format }, api_name: :format
|
|
13
13
|
|
|
14
14
|
# @!attribute voice
|
|
15
|
-
# The voice the model uses to respond. Supported voices are `alloy`,
|
|
16
|
-
# `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`,
|
|
15
|
+
# The voice the model uses to respond. Supported built-in voices are `alloy`,
|
|
16
|
+
# `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
|
|
17
|
+
# `marin`, and `cedar`.
|
|
17
18
|
#
|
|
18
19
|
# @return [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
|
|
19
20
|
required :voice, union: -> { OpenAI::Chat::ChatCompletionAudioParam::Voice }
|
|
@@ -28,7 +29,7 @@ module OpenAI
|
|
|
28
29
|
#
|
|
29
30
|
# @param format_ [Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Format] Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,
|
|
30
31
|
#
|
|
31
|
-
# @param voice [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] The voice the model uses to respond. Supported voices are
|
|
32
|
+
# @param voice [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
|
|
32
33
|
|
|
33
34
|
# Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`,
|
|
34
35
|
# or `pcm16`.
|
|
@@ -48,8 +49,9 @@ module OpenAI
|
|
|
48
49
|
# @return [Array<Symbol>]
|
|
49
50
|
end
|
|
50
51
|
|
|
51
|
-
# The voice the model uses to respond. Supported voices are `alloy`,
|
|
52
|
-
# `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`,
|
|
52
|
+
# The voice the model uses to respond. Supported built-in voices are `alloy`,
|
|
53
|
+
# `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
|
|
54
|
+
# `marin`, and `cedar`.
|
|
53
55
|
#
|
|
54
56
|
# @see OpenAI::Models::Chat::ChatCompletionAudioParam#voice
|
|
55
57
|
module Voice
|
|
@@ -57,7 +57,7 @@ module OpenAI
|
|
|
57
57
|
# A tool call that executes one or more shell commands in a managed environment.
|
|
58
58
|
variant :shell_call, -> { OpenAI::Responses::ResponseFunctionShellToolCall }
|
|
59
59
|
|
|
60
|
-
# The output of a shell tool call.
|
|
60
|
+
# The output of a shell tool call that was emitted.
|
|
61
61
|
variant :shell_call_output, -> { OpenAI::Responses::ResponseFunctionShellToolCallOutput }
|
|
62
62
|
|
|
63
63
|
# A tool call that applies file diffs by creating, deleting, or updating files.
|
|
@@ -14,10 +14,14 @@ module OpenAI
|
|
|
14
14
|
required :file, OpenAI::Internal::Type::FileInput
|
|
15
15
|
|
|
16
16
|
# @!attribute purpose
|
|
17
|
-
# The intended purpose of the uploaded file. One of:
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
17
|
+
# The intended purpose of the uploaded file. One of:
|
|
18
|
+
#
|
|
19
|
+
# - `assistants`: Used in the Assistants API
|
|
20
|
+
# - `batch`: Used in the Batch API
|
|
21
|
+
# - `fine-tune`: Used for fine-tuning
|
|
22
|
+
# - `vision`: Images used for vision fine-tuning
|
|
23
|
+
# - `user_data`: Flexible file type for any purpose
|
|
24
|
+
# - `evals`: Used for eval data sets
|
|
21
25
|
#
|
|
22
26
|
# @return [Symbol, OpenAI::Models::FilePurpose]
|
|
23
27
|
required :purpose, enum: -> { OpenAI::FilePurpose }
|
|
@@ -35,7 +39,7 @@ module OpenAI
|
|
|
35
39
|
#
|
|
36
40
|
# @param file [Pathname, StringIO, IO, String, OpenAI::FilePart] The File object (not file name) to be uploaded.
|
|
37
41
|
#
|
|
38
|
-
# @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. One of:
|
|
42
|
+
# @param purpose [Symbol, OpenAI::Models::FilePurpose] The intended purpose of the uploaded file. One of:
|
|
39
43
|
#
|
|
40
44
|
# @param expires_after [OpenAI::Models::FileCreateParams::ExpiresAfter] The expiration policy for a file. By default, files with `purpose=batch` expire
|
|
41
45
|
#
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
|
-
# The intended purpose of the uploaded file. One of:
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
5
|
+
# The intended purpose of the uploaded file. One of:
|
|
6
|
+
#
|
|
7
|
+
# - `assistants`: Used in the Assistants API
|
|
8
|
+
# - `batch`: Used in the Batch API
|
|
9
|
+
# - `fine-tune`: Used for fine-tuning
|
|
10
|
+
# - `vision`: Images used for vision fine-tuning
|
|
11
|
+
# - `user_data`: Flexible file type for any purpose
|
|
12
|
+
# - `evals`: Used for eval data sets
|
|
9
13
|
module FilePurpose
|
|
10
14
|
extend OpenAI::Internal::Type::Enum
|
|
11
15
|
|
|
@@ -24,10 +24,14 @@ module OpenAI
|
|
|
24
24
|
|
|
25
25
|
# @!attribute previous_item_id
|
|
26
26
|
# The ID of the preceding item after which the new item will be inserted. If not
|
|
27
|
-
# set, the new item will be appended to the end of the conversation.
|
|
28
|
-
#
|
|
29
|
-
# to
|
|
30
|
-
#
|
|
27
|
+
# set, the new item will be appended to the end of the conversation.
|
|
28
|
+
#
|
|
29
|
+
# If set to `root`, the new item will be added to the beginning of the
|
|
30
|
+
# conversation.
|
|
31
|
+
#
|
|
32
|
+
# If set to an existing ID, it allows an item to be inserted mid-conversation. If
|
|
33
|
+
# the ID cannot be found, an error will be returned and the item will not be
|
|
34
|
+
# added.
|
|
31
35
|
#
|
|
32
36
|
# @return [String, nil]
|
|
33
37
|
optional :previous_item_id, String
|
|
@@ -48,7 +52,7 @@ module OpenAI
|
|
|
48
52
|
#
|
|
49
53
|
# @param event_id [String] Optional client-generated ID used to identify this event.
|
|
50
54
|
#
|
|
51
|
-
# @param previous_item_id [String] The ID of the preceding item after which the new item will be inserted.
|
|
55
|
+
# @param previous_item_id [String] The ID of the preceding item after which the new item will be inserted. If not s
|
|
52
56
|
#
|
|
53
57
|
# @param type [Symbol, :"conversation.item.create"] The event type, must be `conversation.item.create`.
|
|
54
58
|
end
|
|
@@ -23,10 +23,10 @@ module OpenAI
|
|
|
23
23
|
optional :speed, Float
|
|
24
24
|
|
|
25
25
|
# @!attribute voice
|
|
26
|
-
# The voice the model uses to respond.
|
|
27
|
-
#
|
|
28
|
-
# `
|
|
29
|
-
#
|
|
26
|
+
# The voice the model uses to respond. Supported built-in voices are `alloy`,
|
|
27
|
+
# `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
|
|
28
|
+
# `cedar`. Voice cannot be changed during the session once the model has responded
|
|
29
|
+
# with audio at least once. We recommend `marin` and `cedar` for best quality.
|
|
30
30
|
#
|
|
31
31
|
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice, nil]
|
|
32
32
|
optional :voice, union: -> { OpenAI::Realtime::RealtimeAudioConfigOutput::Voice }
|
|
@@ -39,12 +39,12 @@ module OpenAI
|
|
|
39
39
|
#
|
|
40
40
|
# @param speed [Float] The speed of the model's spoken response as a multiple of the original speed.
|
|
41
41
|
#
|
|
42
|
-
# @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice] The voice the model uses to respond.
|
|
42
|
+
# @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
|
|
43
43
|
|
|
44
|
-
# The voice the model uses to respond.
|
|
45
|
-
#
|
|
46
|
-
# `
|
|
47
|
-
#
|
|
44
|
+
# The voice the model uses to respond. Supported built-in voices are `alloy`,
|
|
45
|
+
# `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
|
|
46
|
+
# `cedar`. Voice cannot be changed during the session once the model has responded
|
|
47
|
+
# with audio at least once. We recommend `marin` and `cedar` for best quality.
|
|
48
48
|
#
|
|
49
49
|
# @see OpenAI::Models::Realtime::RealtimeAudioConfigOutput#voice
|
|
50
50
|
module Voice
|
|
@@ -23,10 +23,10 @@ module OpenAI
|
|
|
23
23
|
optional :format_, union: -> { OpenAI::Realtime::RealtimeAudioFormats }, api_name: :format
|
|
24
24
|
|
|
25
25
|
# @!attribute voice
|
|
26
|
-
# The voice the model uses to respond.
|
|
27
|
-
#
|
|
28
|
-
# `
|
|
29
|
-
#
|
|
26
|
+
# The voice the model uses to respond. Supported built-in voices are `alloy`,
|
|
27
|
+
# `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
|
|
28
|
+
# `cedar`. Voice cannot be changed during the session once the model has responded
|
|
29
|
+
# with audio at least once.
|
|
30
30
|
#
|
|
31
31
|
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice, nil]
|
|
32
32
|
optional :voice, union: -> { OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice }
|
|
@@ -38,12 +38,12 @@ module OpenAI
|
|
|
38
38
|
#
|
|
39
39
|
# @param format_ [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA] The format of the output audio.
|
|
40
40
|
#
|
|
41
|
-
# @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice] The voice the model uses to respond.
|
|
41
|
+
# @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice] The voice the model uses to respond. Supported built-in voices are `alloy`, `ash
|
|
42
42
|
|
|
43
|
-
# The voice the model uses to respond.
|
|
44
|
-
#
|
|
45
|
-
# `
|
|
46
|
-
#
|
|
43
|
+
# The voice the model uses to respond. Supported built-in voices are `alloy`,
|
|
44
|
+
# `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
|
|
45
|
+
# `cedar`. Voice cannot be changed during the session once the model has responded
|
|
46
|
+
# with audio at least once.
|
|
47
47
|
#
|
|
48
48
|
# @see OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output#voice
|
|
49
49
|
module Voice
|
|
@@ -28,6 +28,12 @@ module OpenAI
|
|
|
28
28
|
# @return [String]
|
|
29
29
|
required :item_id, String
|
|
30
30
|
|
|
31
|
+
# @!attribute name
|
|
32
|
+
# The name of the function that was called.
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
required :name, String
|
|
36
|
+
|
|
31
37
|
# @!attribute output_index
|
|
32
38
|
# The index of the output item in the response.
|
|
33
39
|
#
|
|
@@ -46,7 +52,7 @@ module OpenAI
|
|
|
46
52
|
# @return [Symbol, :"response.function_call_arguments.done"]
|
|
47
53
|
required :type, const: :"response.function_call_arguments.done"
|
|
48
54
|
|
|
49
|
-
# @!method initialize(arguments:, call_id:, event_id:, item_id:, output_index:, response_id:, type: :"response.function_call_arguments.done")
|
|
55
|
+
# @!method initialize(arguments:, call_id:, event_id:, item_id:, name:, output_index:, response_id:, type: :"response.function_call_arguments.done")
|
|
50
56
|
# Some parameter documentations has been truncated, see
|
|
51
57
|
# {OpenAI::Models::Realtime::ResponseFunctionCallArgumentsDoneEvent} for more
|
|
52
58
|
# details.
|
|
@@ -62,6 +68,8 @@ module OpenAI
|
|
|
62
68
|
#
|
|
63
69
|
# @param item_id [String] The ID of the function call item.
|
|
64
70
|
#
|
|
71
|
+
# @param name [String] The name of the function that was called.
|
|
72
|
+
#
|
|
65
73
|
# @param output_index [Integer] The index of the output item in the response.
|
|
66
74
|
#
|
|
67
75
|
# @param response_id [String] The ID of the response.
|
|
@@ -79,9 +79,7 @@ module OpenAI
|
|
|
79
79
|
optional :text, -> { OpenAI::Responses::InputTokenCountParams::Text }, nil?: true
|
|
80
80
|
|
|
81
81
|
# @!attribute tool_choice
|
|
82
|
-
#
|
|
83
|
-
# response. See the `tools` parameter to see how to specify which tools the model
|
|
84
|
-
# can call.
|
|
82
|
+
# Controls which tool the model should use, if any.
|
|
85
83
|
#
|
|
86
84
|
# @return [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceAllowed, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp, OpenAI::Models::Responses::ToolChoiceCustom, OpenAI::Models::Responses::ToolChoiceApplyPatch, OpenAI::Models::Responses::ToolChoiceShell, nil]
|
|
87
85
|
optional :tool_choice, union: -> { OpenAI::Responses::InputTokenCountParams::ToolChoice }, nil?: true
|
|
@@ -123,7 +121,7 @@ module OpenAI
|
|
|
123
121
|
#
|
|
124
122
|
# @param text [OpenAI::Models::Responses::InputTokenCountParams::Text, nil] Configuration options for a text response from the model. Can be plain
|
|
125
123
|
#
|
|
126
|
-
# @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceAllowed, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp, OpenAI::Models::Responses::ToolChoiceCustom, OpenAI::Models::Responses::ToolChoiceApplyPatch, OpenAI::Models::Responses::ToolChoiceShell, nil]
|
|
124
|
+
# @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceAllowed, OpenAI::Models::Responses::ToolChoiceTypes, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp, OpenAI::Models::Responses::ToolChoiceCustom, OpenAI::Models::Responses::ToolChoiceApplyPatch, OpenAI::Models::Responses::ToolChoiceShell, nil] Controls which tool the model should use, if any.
|
|
127
125
|
#
|
|
128
126
|
# @param tools [Array<OpenAI::Models::Responses::FunctionTool, OpenAI::Models::Responses::FileSearchTool, OpenAI::Models::Responses::ComputerTool, OpenAI::Models::Responses::Tool::Mcp, OpenAI::Models::Responses::Tool::CodeInterpreter, OpenAI::Models::Responses::Tool::ImageGeneration, OpenAI::Models::Responses::Tool::LocalShell, OpenAI::Models::Responses::FunctionShellTool, OpenAI::Models::Responses::CustomTool, OpenAI::Models::Responses::ApplyPatchTool, OpenAI::Models::Responses::WebSearchTool, OpenAI::Models::Responses::WebSearchPreviewTool>, nil] An array of tools the model may call while generating a response. You can specif
|
|
129
127
|
#
|
|
@@ -155,6 +153,7 @@ module OpenAI
|
|
|
155
153
|
# A text input to the model, equivalent to a text input with the `user` role.
|
|
156
154
|
variant String
|
|
157
155
|
|
|
156
|
+
# A list of one or many input items to the model, containing different content types.
|
|
158
157
|
variant -> { OpenAI::Models::Responses::InputTokenCountParams::Input::ResponseInputItemArray }
|
|
159
158
|
|
|
160
159
|
# @!method self.variants
|
|
@@ -227,9 +226,7 @@ module OpenAI
|
|
|
227
226
|
end
|
|
228
227
|
end
|
|
229
228
|
|
|
230
|
-
#
|
|
231
|
-
# response. See the `tools` parameter to see how to specify which tools the model
|
|
232
|
-
# can call.
|
|
229
|
+
# Controls which tool the model should use, if any.
|
|
233
230
|
module ToolChoice
|
|
234
231
|
extend OpenAI::Internal::Type::Union
|
|
235
232
|
|
|
@@ -144,9 +144,16 @@ module OpenAI
|
|
|
144
144
|
# @return [Boolean, nil]
|
|
145
145
|
optional :background, OpenAI::Internal::Type::Boolean, nil?: true
|
|
146
146
|
|
|
147
|
+
# @!attribute completed_at
|
|
148
|
+
# Unix timestamp (in seconds) of when this Response was completed. Only present
|
|
149
|
+
# when the status is `completed`.
|
|
150
|
+
#
|
|
151
|
+
# @return [Float, nil]
|
|
152
|
+
optional :completed_at, Float, nil?: true
|
|
153
|
+
|
|
147
154
|
# @!attribute conversation
|
|
148
|
-
# The conversation that this response
|
|
149
|
-
# from this response
|
|
155
|
+
# The conversation that this response belonged to. Input items and output items
|
|
156
|
+
# from this response were automatically added to this conversation.
|
|
150
157
|
#
|
|
151
158
|
# @return [OpenAI::Models::Responses::Response::Conversation, nil]
|
|
152
159
|
optional :conversation, -> { OpenAI::Responses::Response::Conversation }, nil?: true
|
|
@@ -318,7 +325,7 @@ module OpenAI
|
|
|
318
325
|
texts.join
|
|
319
326
|
end
|
|
320
327
|
|
|
321
|
-
# @!method initialize(id:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
|
|
328
|
+
# @!method initialize(id:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
|
|
322
329
|
# Some parameter documentations has been truncated, see
|
|
323
330
|
# {OpenAI::Models::Responses::Response} for more details.
|
|
324
331
|
#
|
|
@@ -350,7 +357,9 @@ module OpenAI
|
|
|
350
357
|
#
|
|
351
358
|
# @param background [Boolean, nil] Whether to run the model response in the background.
|
|
352
359
|
#
|
|
353
|
-
# @param
|
|
360
|
+
# @param completed_at [Float, nil] Unix timestamp (in seconds) of when this Response was completed.
|
|
361
|
+
#
|
|
362
|
+
# @param conversation [OpenAI::Models::Responses::Response::Conversation, nil] The conversation that this response belonged to. Input items and output items fr
|
|
354
363
|
#
|
|
355
364
|
# @param max_output_tokens [Integer, nil] An upper bound for the number of tokens that can be generated for a response, in
|
|
356
365
|
#
|
|
@@ -484,16 +493,16 @@ module OpenAI
|
|
|
484
493
|
# @see OpenAI::Models::Responses::Response#conversation
|
|
485
494
|
class Conversation < OpenAI::Internal::Type::BaseModel
|
|
486
495
|
# @!attribute id
|
|
487
|
-
# The unique ID of the conversation.
|
|
496
|
+
# The unique ID of the conversation that this response was associated with.
|
|
488
497
|
#
|
|
489
498
|
# @return [String]
|
|
490
499
|
required :id, String
|
|
491
500
|
|
|
492
501
|
# @!method initialize(id:)
|
|
493
|
-
# The conversation that this response
|
|
494
|
-
# from this response
|
|
502
|
+
# The conversation that this response belonged to. Input items and output items
|
|
503
|
+
# from this response were automatically added to this conversation.
|
|
495
504
|
#
|
|
496
|
-
# @param id [String] The unique ID of the conversation.
|
|
505
|
+
# @param id [String] The unique ID of the conversation that this response was associated with.
|
|
497
506
|
end
|
|
498
507
|
|
|
499
508
|
# The retention policy for the prompt cache. Set to `24h` to enable extended
|
|
@@ -344,6 +344,7 @@ module OpenAI
|
|
|
344
344
|
# A text input to the model, equivalent to a text input with the `user` role.
|
|
345
345
|
variant String
|
|
346
346
|
|
|
347
|
+
# A list of one or many input items to the model, containing different content types.
|
|
347
348
|
variant -> { OpenAI::Models::Responses::ResponseCompactParams::Input::ResponseInputItemArray }
|
|
348
349
|
|
|
349
350
|
# @!method self.variants
|
|
@@ -11,6 +11,7 @@ module OpenAI
|
|
|
11
11
|
required :id, String
|
|
12
12
|
|
|
13
13
|
# @!attribute encrypted_content
|
|
14
|
+
# The encrypted content that was produced by compaction.
|
|
14
15
|
#
|
|
15
16
|
# @return [String]
|
|
16
17
|
required :encrypted_content, String
|
|
@@ -22,6 +23,7 @@ module OpenAI
|
|
|
22
23
|
required :type, const: :compaction
|
|
23
24
|
|
|
24
25
|
# @!attribute created_by
|
|
26
|
+
# The identifier of the actor that created the item.
|
|
25
27
|
#
|
|
26
28
|
# @return [String, nil]
|
|
27
29
|
optional :created_by, String
|
|
@@ -32,9 +34,9 @@ module OpenAI
|
|
|
32
34
|
#
|
|
33
35
|
# @param id [String] The unique ID of the compaction item.
|
|
34
36
|
#
|
|
35
|
-
# @param encrypted_content [String]
|
|
37
|
+
# @param encrypted_content [String] The encrypted content that was produced by compaction.
|
|
36
38
|
#
|
|
37
|
-
# @param created_by [String]
|
|
39
|
+
# @param created_by [String] The identifier of the actor that created the item.
|
|
38
40
|
#
|
|
39
41
|
# @param type [Symbol, :compaction] The type of the item. Always `compaction`.
|
|
40
42
|
end
|
|
@@ -5,6 +5,7 @@ module OpenAI
|
|
|
5
5
|
module Responses
|
|
6
6
|
class ResponseCompactionItemParam < OpenAI::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute encrypted_content
|
|
8
|
+
# The encrypted content of the compaction summary.
|
|
8
9
|
#
|
|
9
10
|
# @return [String]
|
|
10
11
|
required :encrypted_content, String
|
|
@@ -25,7 +26,7 @@ module OpenAI
|
|
|
25
26
|
# A compaction item generated by the
|
|
26
27
|
# [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
|
|
27
28
|
#
|
|
28
|
-
# @param encrypted_content [String]
|
|
29
|
+
# @param encrypted_content [String] The encrypted content of the compaction summary.
|
|
29
30
|
#
|
|
30
31
|
# @param id [String, nil] The ID of the compaction item.
|
|
31
32
|
#
|