openai 0.23.3 → 0.25.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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/openai/errors.rb +25 -11
  5. data/lib/openai/internal/conversation_cursor_page.rb +1 -1
  6. data/lib/openai/internal/cursor_page.rb +1 -1
  7. data/lib/openai/internal/page.rb +1 -1
  8. data/lib/openai/internal/stream.rb +1 -0
  9. data/lib/openai/internal/transport/base_client.rb +11 -7
  10. data/lib/openai/internal/type/base_page.rb +1 -1
  11. data/lib/openai/internal/type/base_stream.rb +9 -1
  12. data/lib/openai/internal/util.rb +1 -1
  13. data/lib/openai/models/conversations/computer_screenshot_content.rb +2 -0
  14. data/lib/openai/models/conversations/conversation_item.rb +1 -0
  15. data/lib/openai/models/conversations/input_file_content.rb +1 -34
  16. data/lib/openai/models/conversations/input_image_content.rb +1 -54
  17. data/lib/openai/models/conversations/input_text_content.rb +1 -18
  18. data/lib/openai/models/conversations/message.rb +43 -8
  19. data/lib/openai/models/conversations/output_text_content.rb +1 -49
  20. data/lib/openai/models/conversations/refusal_content.rb +1 -18
  21. data/lib/openai/models/conversations/summary_text_content.rb +7 -2
  22. data/lib/openai/models/conversations/text_content.rb +2 -0
  23. data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +13 -1
  24. data/lib/openai/models/evals/run_cancel_response.rb +13 -1
  25. data/lib/openai/models/evals/run_create_params.rb +13 -1
  26. data/lib/openai/models/evals/run_create_response.rb +13 -1
  27. data/lib/openai/models/evals/run_list_response.rb +13 -1
  28. data/lib/openai/models/evals/run_retrieve_response.rb +13 -1
  29. data/lib/openai/models/evals/runs/output_item_list_response.rb +49 -4
  30. data/lib/openai/models/evals/runs/output_item_retrieve_response.rb +49 -4
  31. data/lib/openai/models/graders/score_model_grader.rb +56 -3
  32. data/lib/openai/models/responses/response_content.rb +25 -1
  33. data/lib/openai/models/responses/response_content_part_added_event.rb +27 -3
  34. data/lib/openai/models/responses/response_content_part_done_event.rb +27 -3
  35. data/lib/openai/models/responses/response_reasoning_item.rb +6 -8
  36. data/lib/openai/version.rb +1 -1
  37. data/lib/openai.rb +5 -10
  38. data/rbi/openai/errors.rbi +29 -2
  39. data/rbi/openai/internal/transport/base_client.rbi +4 -5
  40. data/rbi/openai/internal/type/base_page.rbi +1 -1
  41. data/rbi/openai/internal/type/base_stream.rbi +16 -1
  42. data/rbi/openai/internal/util.rbi +1 -1
  43. data/rbi/openai/models/conversations/computer_screenshot_content.rbi +1 -0
  44. data/rbi/openai/models/conversations/input_file_content.rbi +1 -64
  45. data/rbi/openai/models/conversations/input_image_content.rbi +1 -105
  46. data/rbi/openai/models/conversations/input_text_content.rbi +1 -30
  47. data/rbi/openai/models/conversations/message.rbi +46 -10
  48. data/rbi/openai/models/conversations/output_text_content.rbi +1 -102
  49. data/rbi/openai/models/conversations/refusal_content.rbi +1 -30
  50. data/rbi/openai/models/conversations/summary_text_content.rbi +9 -1
  51. data/rbi/openai/models/conversations/text_content.rbi +1 -0
  52. data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +16 -0
  53. data/rbi/openai/models/evals/run_cancel_response.rbi +18 -0
  54. data/rbi/openai/models/evals/run_create_params.rbi +18 -0
  55. data/rbi/openai/models/evals/run_create_response.rbi +18 -0
  56. data/rbi/openai/models/evals/run_list_response.rbi +18 -0
  57. data/rbi/openai/models/evals/run_retrieve_response.rbi +18 -0
  58. data/rbi/openai/models/evals/runs/output_item_list_response.rbi +88 -5
  59. data/rbi/openai/models/evals/runs/output_item_retrieve_response.rbi +88 -5
  60. data/rbi/openai/models/graders/score_model_grader.rbi +88 -4
  61. data/rbi/openai/models/responses/response_content.rbi +34 -1
  62. data/rbi/openai/models/responses/response_content_part_added_event.rbi +36 -2
  63. data/rbi/openai/models/responses/response_content_part_done_event.rbi +36 -2
  64. data/rbi/openai/models/responses/response_reasoning_item.rbi +6 -4
  65. data/sig/openai/errors.rbs +7 -0
  66. data/sig/openai/internal/type/base_stream.rbs +5 -0
  67. data/sig/openai/models/conversations/input_file_content.rbs +1 -35
  68. data/sig/openai/models/conversations/input_image_content.rbs +1 -43
  69. data/sig/openai/models/conversations/input_text_content.rbs +1 -11
  70. data/sig/openai/models/conversations/message.rbs +18 -5
  71. data/sig/openai/models/conversations/output_text_content.rbs +1 -46
  72. data/sig/openai/models/conversations/refusal_content.rbs +1 -11
  73. data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +5 -0
  74. data/sig/openai/models/evals/run_cancel_response.rbs +5 -0
  75. data/sig/openai/models/evals/run_create_params.rbs +5 -0
  76. data/sig/openai/models/evals/run_create_response.rbs +5 -0
  77. data/sig/openai/models/evals/run_list_response.rbs +5 -0
  78. data/sig/openai/models/evals/run_retrieve_response.rbs +5 -0
  79. data/sig/openai/models/evals/runs/output_item_list_response.rbs +43 -4
  80. data/sig/openai/models/evals/runs/output_item_retrieve_response.rbs +43 -4
  81. data/sig/openai/models/graders/score_model_grader.rbs +44 -5
  82. data/sig/openai/models/responses/response_content.rbs +13 -0
  83. data/sig/openai/models/responses/response_content_part_added_event.rbs +13 -0
  84. data/sig/openai/models/responses/response_content_part_done_event.rbs +13 -0
  85. metadata +2 -17
  86. data/lib/openai/models/conversations/container_file_citation_body.rb +0 -58
  87. data/lib/openai/models/conversations/file_citation_body.rb +0 -42
  88. data/lib/openai/models/conversations/lob_prob.rb +0 -35
  89. data/lib/openai/models/conversations/top_log_prob.rb +0 -29
  90. data/lib/openai/models/conversations/url_citation_body.rb +0 -50
  91. data/rbi/openai/models/conversations/container_file_citation_body.rbi +0 -82
  92. data/rbi/openai/models/conversations/file_citation_body.rbi +0 -61
  93. data/rbi/openai/models/conversations/lob_prob.rbi +0 -50
  94. data/rbi/openai/models/conversations/top_log_prob.rbi +0 -41
  95. data/rbi/openai/models/conversations/url_citation_body.rbi +0 -74
  96. data/sig/openai/models/conversations/container_file_citation_body.rbs +0 -47
  97. data/sig/openai/models/conversations/file_citation_body.rbs +0 -37
  98. data/sig/openai/models/conversations/lob_prob.rbs +0 -37
  99. data/sig/openai/models/conversations/top_log_prob.rbs +0 -28
  100. data/sig/openai/models/conversations/url_citation_body.rbs +0 -42
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module OpenAI
4
- module Models
5
- module Conversations
6
- class LobProb < OpenAI::Internal::Type::BaseModel
7
- # @!attribute token
8
- #
9
- # @return [String]
10
- required :token, String
11
-
12
- # @!attribute bytes
13
- #
14
- # @return [Array<Integer>]
15
- required :bytes, OpenAI::Internal::Type::ArrayOf[Integer]
16
-
17
- # @!attribute logprob
18
- #
19
- # @return [Float]
20
- required :logprob, Float
21
-
22
- # @!attribute top_logprobs
23
- #
24
- # @return [Array<OpenAI::Models::Conversations::TopLogProb>]
25
- required :top_logprobs, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Conversations::TopLogProb] }
26
-
27
- # @!method initialize(token:, bytes:, logprob:, top_logprobs:)
28
- # @param token [String]
29
- # @param bytes [Array<Integer>]
30
- # @param logprob [Float]
31
- # @param top_logprobs [Array<OpenAI::Models::Conversations::TopLogProb>]
32
- end
33
- end
34
- end
35
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module OpenAI
4
- module Models
5
- module Conversations
6
- class TopLogProb < OpenAI::Internal::Type::BaseModel
7
- # @!attribute token
8
- #
9
- # @return [String]
10
- required :token, String
11
-
12
- # @!attribute bytes
13
- #
14
- # @return [Array<Integer>]
15
- required :bytes, OpenAI::Internal::Type::ArrayOf[Integer]
16
-
17
- # @!attribute logprob
18
- #
19
- # @return [Float]
20
- required :logprob, Float
21
-
22
- # @!method initialize(token:, bytes:, logprob:)
23
- # @param token [String]
24
- # @param bytes [Array<Integer>]
25
- # @param logprob [Float]
26
- end
27
- end
28
- end
29
- end
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module OpenAI
4
- module Models
5
- module Conversations
6
- class URLCitationBody < OpenAI::Internal::Type::BaseModel
7
- # @!attribute end_index
8
- # The index of the last character of the URL citation in the message.
9
- #
10
- # @return [Integer]
11
- required :end_index, Integer
12
-
13
- # @!attribute start_index
14
- # The index of the first character of the URL citation in the message.
15
- #
16
- # @return [Integer]
17
- required :start_index, Integer
18
-
19
- # @!attribute title
20
- # The title of the web resource.
21
- #
22
- # @return [String]
23
- required :title, String
24
-
25
- # @!attribute type
26
- # The type of the URL citation. Always `url_citation`.
27
- #
28
- # @return [Symbol, :url_citation]
29
- required :type, const: :url_citation
30
-
31
- # @!attribute url
32
- # The URL of the web resource.
33
- #
34
- # @return [String]
35
- required :url, String
36
-
37
- # @!method initialize(end_index:, start_index:, title:, url:, type: :url_citation)
38
- # @param end_index [Integer] The index of the last character of the URL citation in the message.
39
- #
40
- # @param start_index [Integer] The index of the first character of the URL citation in the message.
41
- #
42
- # @param title [String] The title of the web resource.
43
- #
44
- # @param url [String] The URL of the web resource.
45
- #
46
- # @param type [Symbol, :url_citation] The type of the URL citation. Always `url_citation`.
47
- end
48
- end
49
- end
50
- end
@@ -1,82 +0,0 @@
1
- # typed: strong
2
-
3
- module OpenAI
4
- module Models
5
- module Conversations
6
- class ContainerFileCitationBody < OpenAI::Internal::Type::BaseModel
7
- OrHash =
8
- T.type_alias do
9
- T.any(
10
- OpenAI::Conversations::ContainerFileCitationBody,
11
- OpenAI::Internal::AnyHash
12
- )
13
- end
14
-
15
- # The ID of the container file.
16
- sig { returns(String) }
17
- attr_accessor :container_id
18
-
19
- # The index of the last character of the container file citation in the message.
20
- sig { returns(Integer) }
21
- attr_accessor :end_index
22
-
23
- # The ID of the file.
24
- sig { returns(String) }
25
- attr_accessor :file_id
26
-
27
- # The filename of the container file cited.
28
- sig { returns(String) }
29
- attr_accessor :filename
30
-
31
- # The index of the first character of the container file citation in the message.
32
- sig { returns(Integer) }
33
- attr_accessor :start_index
34
-
35
- # The type of the container file citation. Always `container_file_citation`.
36
- sig { returns(Symbol) }
37
- attr_accessor :type
38
-
39
- sig do
40
- params(
41
- container_id: String,
42
- end_index: Integer,
43
- file_id: String,
44
- filename: String,
45
- start_index: Integer,
46
- type: Symbol
47
- ).returns(T.attached_class)
48
- end
49
- def self.new(
50
- # The ID of the container file.
51
- container_id:,
52
- # The index of the last character of the container file citation in the message.
53
- end_index:,
54
- # The ID of the file.
55
- file_id:,
56
- # The filename of the container file cited.
57
- filename:,
58
- # The index of the first character of the container file citation in the message.
59
- start_index:,
60
- # The type of the container file citation. Always `container_file_citation`.
61
- type: :container_file_citation
62
- )
63
- end
64
-
65
- sig do
66
- override.returns(
67
- {
68
- container_id: String,
69
- end_index: Integer,
70
- file_id: String,
71
- filename: String,
72
- start_index: Integer,
73
- type: Symbol
74
- }
75
- )
76
- end
77
- def to_hash
78
- end
79
- end
80
- end
81
- end
82
- end
@@ -1,61 +0,0 @@
1
- # typed: strong
2
-
3
- module OpenAI
4
- module Models
5
- module Conversations
6
- class FileCitationBody < OpenAI::Internal::Type::BaseModel
7
- OrHash =
8
- T.type_alias do
9
- T.any(
10
- OpenAI::Conversations::FileCitationBody,
11
- OpenAI::Internal::AnyHash
12
- )
13
- end
14
-
15
- # The ID of the file.
16
- sig { returns(String) }
17
- attr_accessor :file_id
18
-
19
- # The filename of the file cited.
20
- sig { returns(String) }
21
- attr_accessor :filename
22
-
23
- # The index of the file in the list of files.
24
- sig { returns(Integer) }
25
- attr_accessor :index
26
-
27
- # The type of the file citation. Always `file_citation`.
28
- sig { returns(Symbol) }
29
- attr_accessor :type
30
-
31
- sig do
32
- params(
33
- file_id: String,
34
- filename: String,
35
- index: Integer,
36
- type: Symbol
37
- ).returns(T.attached_class)
38
- end
39
- def self.new(
40
- # The ID of the file.
41
- file_id:,
42
- # The filename of the file cited.
43
- filename:,
44
- # The index of the file in the list of files.
45
- index:,
46
- # The type of the file citation. Always `file_citation`.
47
- type: :file_citation
48
- )
49
- end
50
-
51
- sig do
52
- override.returns(
53
- { file_id: String, filename: String, index: Integer, type: Symbol }
54
- )
55
- end
56
- def to_hash
57
- end
58
- end
59
- end
60
- end
61
- end
@@ -1,50 +0,0 @@
1
- # typed: strong
2
-
3
- module OpenAI
4
- module Models
5
- module Conversations
6
- class LobProb < OpenAI::Internal::Type::BaseModel
7
- OrHash =
8
- T.type_alias do
9
- T.any(OpenAI::Conversations::LobProb, OpenAI::Internal::AnyHash)
10
- end
11
-
12
- sig { returns(String) }
13
- attr_accessor :token
14
-
15
- sig { returns(T::Array[Integer]) }
16
- attr_accessor :bytes
17
-
18
- sig { returns(Float) }
19
- attr_accessor :logprob
20
-
21
- sig { returns(T::Array[OpenAI::Conversations::TopLogProb]) }
22
- attr_accessor :top_logprobs
23
-
24
- sig do
25
- params(
26
- token: String,
27
- bytes: T::Array[Integer],
28
- logprob: Float,
29
- top_logprobs: T::Array[OpenAI::Conversations::TopLogProb::OrHash]
30
- ).returns(T.attached_class)
31
- end
32
- def self.new(token:, bytes:, logprob:, top_logprobs:)
33
- end
34
-
35
- sig do
36
- override.returns(
37
- {
38
- token: String,
39
- bytes: T::Array[Integer],
40
- logprob: Float,
41
- top_logprobs: T::Array[OpenAI::Conversations::TopLogProb]
42
- }
43
- )
44
- end
45
- def to_hash
46
- end
47
- end
48
- end
49
- end
50
- end
@@ -1,41 +0,0 @@
1
- # typed: strong
2
-
3
- module OpenAI
4
- module Models
5
- module Conversations
6
- class TopLogProb < OpenAI::Internal::Type::BaseModel
7
- OrHash =
8
- T.type_alias do
9
- T.any(OpenAI::Conversations::TopLogProb, OpenAI::Internal::AnyHash)
10
- end
11
-
12
- sig { returns(String) }
13
- attr_accessor :token
14
-
15
- sig { returns(T::Array[Integer]) }
16
- attr_accessor :bytes
17
-
18
- sig { returns(Float) }
19
- attr_accessor :logprob
20
-
21
- sig do
22
- params(
23
- token: String,
24
- bytes: T::Array[Integer],
25
- logprob: Float
26
- ).returns(T.attached_class)
27
- end
28
- def self.new(token:, bytes:, logprob:)
29
- end
30
-
31
- sig do
32
- override.returns(
33
- { token: String, bytes: T::Array[Integer], logprob: Float }
34
- )
35
- end
36
- def to_hash
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,74 +0,0 @@
1
- # typed: strong
2
-
3
- module OpenAI
4
- module Models
5
- module Conversations
6
- class URLCitationBody < OpenAI::Internal::Type::BaseModel
7
- OrHash =
8
- T.type_alias do
9
- T.any(
10
- OpenAI::Conversations::URLCitationBody,
11
- OpenAI::Internal::AnyHash
12
- )
13
- end
14
-
15
- # The index of the last character of the URL citation in the message.
16
- sig { returns(Integer) }
17
- attr_accessor :end_index
18
-
19
- # The index of the first character of the URL citation in the message.
20
- sig { returns(Integer) }
21
- attr_accessor :start_index
22
-
23
- # The title of the web resource.
24
- sig { returns(String) }
25
- attr_accessor :title
26
-
27
- # The type of the URL citation. Always `url_citation`.
28
- sig { returns(Symbol) }
29
- attr_accessor :type
30
-
31
- # The URL of the web resource.
32
- sig { returns(String) }
33
- attr_accessor :url
34
-
35
- sig do
36
- params(
37
- end_index: Integer,
38
- start_index: Integer,
39
- title: String,
40
- url: String,
41
- type: Symbol
42
- ).returns(T.attached_class)
43
- end
44
- def self.new(
45
- # The index of the last character of the URL citation in the message.
46
- end_index:,
47
- # The index of the first character of the URL citation in the message.
48
- start_index:,
49
- # The title of the web resource.
50
- title:,
51
- # The URL of the web resource.
52
- url:,
53
- # The type of the URL citation. Always `url_citation`.
54
- type: :url_citation
55
- )
56
- end
57
-
58
- sig do
59
- override.returns(
60
- {
61
- end_index: Integer,
62
- start_index: Integer,
63
- title: String,
64
- type: Symbol,
65
- url: String
66
- }
67
- )
68
- end
69
- def to_hash
70
- end
71
- end
72
- end
73
- end
74
- end
@@ -1,47 +0,0 @@
1
- module OpenAI
2
- module Models
3
- module Conversations
4
- type container_file_citation_body =
5
- {
6
- container_id: String,
7
- end_index: Integer,
8
- file_id: String,
9
- filename: String,
10
- start_index: Integer,
11
- type: :container_file_citation
12
- }
13
-
14
- class ContainerFileCitationBody < OpenAI::Internal::Type::BaseModel
15
- attr_accessor container_id: String
16
-
17
- attr_accessor end_index: Integer
18
-
19
- attr_accessor file_id: String
20
-
21
- attr_accessor filename: String
22
-
23
- attr_accessor start_index: Integer
24
-
25
- attr_accessor type: :container_file_citation
26
-
27
- def initialize: (
28
- container_id: String,
29
- end_index: Integer,
30
- file_id: String,
31
- filename: String,
32
- start_index: Integer,
33
- ?type: :container_file_citation
34
- ) -> void
35
-
36
- def to_hash: -> {
37
- container_id: String,
38
- end_index: Integer,
39
- file_id: String,
40
- filename: String,
41
- start_index: Integer,
42
- type: :container_file_citation
43
- }
44
- end
45
- end
46
- end
47
- end
@@ -1,37 +0,0 @@
1
- module OpenAI
2
- module Models
3
- module Conversations
4
- type file_citation_body =
5
- {
6
- file_id: String,
7
- filename: String,
8
- index: Integer,
9
- type: :file_citation
10
- }
11
-
12
- class FileCitationBody < OpenAI::Internal::Type::BaseModel
13
- attr_accessor file_id: String
14
-
15
- attr_accessor filename: String
16
-
17
- attr_accessor index: Integer
18
-
19
- attr_accessor type: :file_citation
20
-
21
- def initialize: (
22
- file_id: String,
23
- filename: String,
24
- index: Integer,
25
- ?type: :file_citation
26
- ) -> void
27
-
28
- def to_hash: -> {
29
- file_id: String,
30
- filename: String,
31
- index: Integer,
32
- type: :file_citation
33
- }
34
- end
35
- end
36
- end
37
- end
@@ -1,37 +0,0 @@
1
- module OpenAI
2
- module Models
3
- module Conversations
4
- type lob_prob =
5
- {
6
- token: String,
7
- bytes: ::Array[Integer],
8
- logprob: Float,
9
- top_logprobs: ::Array[OpenAI::Conversations::TopLogProb]
10
- }
11
-
12
- class LobProb < OpenAI::Internal::Type::BaseModel
13
- attr_accessor token: String
14
-
15
- attr_accessor bytes: ::Array[Integer]
16
-
17
- attr_accessor logprob: Float
18
-
19
- attr_accessor top_logprobs: ::Array[OpenAI::Conversations::TopLogProb]
20
-
21
- def initialize: (
22
- token: String,
23
- bytes: ::Array[Integer],
24
- logprob: Float,
25
- top_logprobs: ::Array[OpenAI::Conversations::TopLogProb]
26
- ) -> void
27
-
28
- def to_hash: -> {
29
- token: String,
30
- bytes: ::Array[Integer],
31
- logprob: Float,
32
- top_logprobs: ::Array[OpenAI::Conversations::TopLogProb]
33
- }
34
- end
35
- end
36
- end
37
- end
@@ -1,28 +0,0 @@
1
- module OpenAI
2
- module Models
3
- module Conversations
4
- type top_log_prob =
5
- { token: String, bytes: ::Array[Integer], logprob: Float }
6
-
7
- class TopLogProb < OpenAI::Internal::Type::BaseModel
8
- attr_accessor token: String
9
-
10
- attr_accessor bytes: ::Array[Integer]
11
-
12
- attr_accessor logprob: Float
13
-
14
- def initialize: (
15
- token: String,
16
- bytes: ::Array[Integer],
17
- logprob: Float
18
- ) -> void
19
-
20
- def to_hash: -> {
21
- token: String,
22
- bytes: ::Array[Integer],
23
- logprob: Float
24
- }
25
- end
26
- end
27
- end
28
- end
@@ -1,42 +0,0 @@
1
- module OpenAI
2
- module Models
3
- module Conversations
4
- type url_citation_body =
5
- {
6
- end_index: Integer,
7
- start_index: Integer,
8
- title: String,
9
- type: :url_citation,
10
- url: String
11
- }
12
-
13
- class URLCitationBody < OpenAI::Internal::Type::BaseModel
14
- attr_accessor end_index: Integer
15
-
16
- attr_accessor start_index: Integer
17
-
18
- attr_accessor title: String
19
-
20
- attr_accessor type: :url_citation
21
-
22
- attr_accessor url: String
23
-
24
- def initialize: (
25
- end_index: Integer,
26
- start_index: Integer,
27
- title: String,
28
- url: String,
29
- ?type: :url_citation
30
- ) -> void
31
-
32
- def to_hash: -> {
33
- end_index: Integer,
34
- start_index: Integer,
35
- title: String,
36
- type: :url_citation,
37
- url: String
38
- }
39
- end
40
- end
41
- end
42
- end