openai 0.97.0 → 0.98.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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +76 -1
  4. data/lib/openai/helpers/agents/session_stream.rb +60 -3
  5. data/lib/openai/helpers/beta/agents/artifacts.rb +72 -0
  6. data/lib/openai/helpers/beta/agents/creation_stream.rb +69 -0
  7. data/lib/openai/helpers/beta/agents/files.rb +236 -0
  8. data/lib/openai/helpers/beta/agents/function_tool.rb +65 -0
  9. data/lib/openai/helpers/beta/agents/model_adapter.rb +27 -0
  10. data/lib/openai/helpers/beta/agents/result.rb +170 -0
  11. data/lib/openai/helpers/beta/agents/typed_output.rb +191 -0
  12. data/lib/openai/helpers/live/websocket.rb +7 -1
  13. data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +1 -1
  14. data/lib/openai/helpers/responses_websocket/connection.rb +7 -1
  15. data/lib/openai/helpers/responses_websocket/session.rb +5 -1
  16. data/lib/openai/helpers/responses_websocket/transports/async_websocket.rb +12 -2
  17. data/lib/openai/internal/transport/base_client.rb +18 -0
  18. data/lib/openai/internal/type/array_of.rb +1 -1
  19. data/lib/openai/internal/type/base_model.rb +6 -3
  20. data/lib/openai/internal/type/converter.rb +50 -3
  21. data/lib/openai/internal/type/hash_of.rb +1 -1
  22. data/lib/openai/internal/type/union.rb +6 -6
  23. data/lib/openai/models/beta/agents/sessions/session_trace.rb +64 -0
  24. data/lib/openai/models/beta/agents/sessions/trace_list_params.rb +68 -0
  25. data/lib/openai/models/beta/agents/vaults/credential.rb +8 -4
  26. data/lib/openai/models/beta/beta_response_output_text.rb +2 -2
  27. data/lib/openai/models/beta/beta_response_output_text_annotation_added_event.rb +2 -2
  28. data/lib/openai/models/beta/environment.rb +33 -1
  29. data/lib/openai/models/beta/environment_param.rb +24 -1
  30. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  31. data/lib/openai/models/chat/chat_completion_content_part_image.rb +1 -0
  32. data/lib/openai/models/live/fork_server_event.rb +14 -3
  33. data/lib/openai/models/live/server_event.rb +14 -3
  34. data/lib/openai/models/realtime/translations/client_secret_create_params.rb +28 -0
  35. data/lib/openai/models/responses/response_output_text.rb +2 -2
  36. data/lib/openai/models/responses/response_output_text_annotation_added_event.rb +2 -2
  37. data/lib/openai/resources/beta/agents/environments/files.rb +31 -0
  38. data/lib/openai/resources/beta/agents/sessions/artifacts.rb +8 -0
  39. data/lib/openai/resources/beta/agents/sessions/events.rb +6 -5
  40. data/lib/openai/resources/beta/agents/sessions/traces.rb +58 -0
  41. data/lib/openai/resources/beta/agents/sessions.rb +18 -5
  42. data/lib/openai/resources/evals/runs.rb +1 -1
  43. data/lib/openai/resources/realtime/translations/client_secrets.rb +58 -0
  44. data/lib/openai/resources/realtime/translations.rb +20 -0
  45. data/lib/openai/resources/realtime.rb +4 -0
  46. data/lib/openai/version.rb +1 -1
  47. data/lib/openai.rb +9 -1
  48. data/rbi/openai/helpers/agents.rbi +20 -1
  49. data/rbi/openai/helpers/beta/agents/artifacts.rbi +29 -0
  50. data/rbi/openai/helpers/beta/agents/files.rbi +65 -0
  51. data/rbi/openai/helpers/beta/agents/function_tool.rbi +40 -0
  52. data/rbi/openai/helpers/beta/agents/model_adapter.rbi +22 -0
  53. data/rbi/openai/helpers/beta/agents.rbi +146 -0
  54. data/rbi/openai/internal/transport/base_client.rbi +12 -0
  55. data/rbi/openai/internal/type/base_model.rbi +2 -2
  56. data/rbi/openai/internal/type/converter.rbi +21 -3
  57. data/rbi/openai/internal/type/union.rbi +6 -2
  58. data/rbi/openai/models/beta/agents/sessions/session_trace.rbi +97 -0
  59. data/rbi/openai/models/beta/agents/sessions/trace_list_params.rbi +121 -0
  60. data/rbi/openai/models/beta/agents/vaults/credential.rbi +5 -5
  61. data/rbi/openai/models/beta/beta_response_output_text.rbi +2 -2
  62. data/rbi/openai/models/beta/beta_response_output_text_annotation_added_event.rbi +2 -2
  63. data/rbi/openai/models/beta/environment.rbi +29 -0
  64. data/rbi/openai/models/beta/environment_param.rbi +31 -0
  65. data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
  66. data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +1 -0
  67. data/rbi/openai/models/live/fork_server_event.rbi +14 -2
  68. data/rbi/openai/models/live/server_event.rbi +14 -2
  69. data/rbi/openai/models/realtime/translations/client_secret_create_params.rbi +68 -0
  70. data/rbi/openai/models/responses/response_output_text.rbi +2 -2
  71. data/rbi/openai/models/responses/response_output_text_annotation_added_event.rbi +2 -2
  72. data/rbi/openai/resources/beta/agents/environments/files.rbi +31 -0
  73. data/rbi/openai/resources/beta/agents/sessions/artifacts.rbi +8 -0
  74. data/rbi/openai/resources/beta/agents/sessions/events.rbi +6 -5
  75. data/rbi/openai/resources/beta/agents/sessions/traces.rbi +54 -0
  76. data/rbi/openai/resources/beta/agents/sessions.rbi +6 -1
  77. data/rbi/openai/resources/realtime/translations/client_secrets.rbi +54 -0
  78. data/rbi/openai/resources/realtime/translations.rbi +22 -0
  79. data/rbi/openai/resources/realtime.rbi +3 -0
  80. data/sig/openai/helpers/agents.rbs +7 -0
  81. data/sig/openai/helpers/beta/agents/artifacts.rbs +20 -0
  82. data/sig/openai/helpers/beta/agents/files.rbs +41 -0
  83. data/sig/openai/helpers/beta/agents/function_tool.rbs +24 -0
  84. data/sig/openai/helpers/beta/agents/model_adapter.rbs +16 -0
  85. data/sig/openai/helpers/beta/agents.rbs +71 -0
  86. data/sig/openai/helpers/structured_output.rbs +12 -0
  87. data/sig/openai/internal/transport/base_client.rbs +8 -0
  88. data/sig/openai/internal/type/base_model.rbs +3 -1
  89. data/sig/openai/internal/type/converter.rbs +16 -2
  90. data/sig/openai/internal/type/union.rbs +2 -1
  91. data/sig/openai/models/beta/agents/sessions/session_trace.rbs +65 -0
  92. data/sig/openai/models/beta/agents/sessions/trace_list_params.rbs +81 -0
  93. data/sig/openai/models/beta/agents/vaults/credential.rbs +5 -5
  94. data/sig/openai/models/beta/beta_response_output_text.rbs +2 -2
  95. data/sig/openai/models/beta/beta_response_output_text_annotation_added_event.rbs +2 -2
  96. data/sig/openai/models/beta/environment.rbs +22 -0
  97. data/sig/openai/models/beta/environment_param.rbs +25 -0
  98. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  99. data/sig/openai/models/chat/chat_completion_content_part_image.rbs +2 -1
  100. data/sig/openai/models/live/fork_server_event.rbs +17 -2
  101. data/sig/openai/models/live/server_event.rbs +17 -2
  102. data/sig/openai/models/realtime/translations/client_secret_create_params.rbs +39 -0
  103. data/sig/openai/models/responses/response_output_text.rbs +2 -2
  104. data/sig/openai/models/responses/response_output_text_annotation_added_event.rbs +2 -2
  105. data/sig/openai/resources/beta/agents/environments/files.rbs +17 -0
  106. data/sig/openai/resources/beta/agents/sessions/artifacts.rbs +4 -0
  107. data/sig/openai/resources/beta/agents/sessions/traces.rbs +21 -0
  108. data/sig/openai/resources/beta/agents/sessions.rbs +4 -1
  109. data/sig/openai/resources/realtime/translations/client_secrets.rbs +17 -0
  110. data/sig/openai/resources/realtime/translations.rbs +11 -0
  111. data/sig/openai/resources/realtime.rbs +2 -0
  112. metadata +37 -1
@@ -0,0 +1,81 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module Agents
5
+ module Sessions
6
+ type trace_list_params =
7
+ {
8
+ session_id: String,
9
+ ?after: String,
10
+ ?limit: Integer,
11
+ ?order: OpenAI::Models::Beta::Agents::Sessions::TraceListParams::order,
12
+ ?request_options: OpenAI::request_opts
13
+ }
14
+
15
+ class TraceListParams < OpenAI::Internal::Type::BaseModel
16
+ extend OpenAI::Internal::Type::RequestParameters::Converter
17
+ include OpenAI::Internal::Type::RequestParameters
18
+
19
+ attr_accessor session_id: String
20
+
21
+ # Return resources after this resource ID in the selected order.
22
+ attr_reader after: String?
23
+
24
+ # Return resources after this resource ID in the selected order.
25
+ def after=: (String) -> String
26
+
27
+ # The maximum number of resources to return, between 1 and 100. Defaults to 20.
28
+ attr_reader limit: Integer?
29
+
30
+ # The maximum number of resources to return, between 1 and 100. Defaults to 20.
31
+ def limit=: (Integer) -> Integer
32
+
33
+ # The order in which resources are returned. Defaults to `desc`.
34
+ attr_reader order: OpenAI::Models::Beta::Agents::Sessions::TraceListParams::order?
35
+
36
+ # The order in which resources are returned. Defaults to `desc`.
37
+ def order=: (
38
+ OpenAI::Models::Beta::Agents::Sessions::TraceListParams::order
39
+ ) -> OpenAI::Models::Beta::Agents::Sessions::TraceListParams::order
40
+
41
+ # @param after
42
+ # Return resources after this resource ID in the selected order.
43
+ # @param limit
44
+ # The maximum number of resources to return, between 1 and 100. Defaults to 20.
45
+ # @param order
46
+ # The order in which resources are returned. Defaults to `desc`.
47
+ def initialize: (
48
+ session_id: String,
49
+ ?after: String,
50
+ ?limit: Integer,
51
+ ?order: OpenAI::Models::Beta::Agents::Sessions::TraceListParams::order,
52
+ ?request_options: OpenAI::request_opts
53
+ ) -> void
54
+
55
+ def to_hash: -> {
56
+ session_id: String,
57
+ ?after: String,
58
+ ?limit: Integer,
59
+ ?order: OpenAI::Models::Beta::Agents::Sessions::TraceListParams::order,
60
+ ?request_options: OpenAI::RequestOptions
61
+ }
62
+
63
+ type order = :asc | :desc
64
+
65
+ module Order
66
+ extend OpenAI::Internal::Type::Enum
67
+
68
+ # Returns resources in ascending order.
69
+ ASC: :asc
70
+
71
+ # Returns resources in descending order.
72
+ DESC: :desc
73
+
74
+ def self?.values: -> ::Array[OpenAI::Models::Beta::Agents::Sessions::TraceListParams::order]
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
@@ -8,7 +8,7 @@ module OpenAI
8
8
  id: String,
9
9
  auth: OpenAI::Models::Beta::Agents::Vaults::credential_auth,
10
10
  created_at: Integer,
11
- metadata: ::Hash[Symbol, String],
11
+ ?metadata: ::Hash[Symbol, String],
12
12
  name: String,
13
13
  ?object: :"vault.credential",
14
14
  updated_at: Integer,
@@ -46,24 +46,24 @@ module OpenAI
46
46
  # The authentication method and non-secret configuration of the credential.
47
47
  # @param created_at
48
48
  # The Unix timestamp, in seconds, when the credential was created.
49
- # @param metadata
50
- # Application-defined key-value pairs associated with this credential.
51
49
  # @param name
52
50
  # The human-readable name of the credential.
53
51
  # @param updated_at
54
52
  # The Unix timestamp, in seconds, when the credential was last updated.
55
53
  # @param vault_id
56
54
  # The ID of the vault containing this credential.
55
+ # @param metadata
56
+ # Application-defined key-value pairs associated with this credential.
57
57
  # @param object
58
58
  # The object type. Always `vault.credential`.
59
59
  def initialize: (
60
60
  id: String,
61
61
  auth: OpenAI::Models::Beta::Agents::Vaults::credential_auth,
62
62
  created_at: Integer,
63
- metadata: ::Hash[Symbol, String],
64
63
  name: String,
65
64
  updated_at: Integer,
66
65
  vault_id: String,
66
+ ?metadata: ::Hash[Symbol, String],
67
67
  ?object: :"vault.credential"
68
68
  ) -> void
69
69
 
@@ -71,7 +71,7 @@ module OpenAI
71
71
  id: String,
72
72
  auth: OpenAI::Models::Beta::Agents::Vaults::credential_auth,
73
73
  created_at: Integer,
74
- metadata: ::Hash[Symbol, String],
74
+ ?metadata: ::Hash[Symbol, String],
75
75
  name: String,
76
76
  ?object: :"vault.credential",
77
77
  updated_at: Integer,
@@ -71,7 +71,7 @@ module OpenAI
71
71
  # The filename of the file cited.
72
72
  attr_accessor filename: String
73
73
 
74
- # The index of the file in the list of files.
74
+ # The index in the output text at which to insert the file citation.
75
75
  attr_accessor index: Integer
76
76
 
77
77
  # The type of the file citation. Always `file_citation`.
@@ -82,7 +82,7 @@ module OpenAI
82
82
  # @param filename
83
83
  # The filename of the file cited.
84
84
  # @param index
85
- # The index of the file in the list of files.
85
+ # The index in the output text at which to insert the file citation.
86
86
  # @param type
87
87
  # The type of the file citation. Always `file_citation`.
88
88
  def initialize: (
@@ -102,7 +102,7 @@ module OpenAI
102
102
  # The filename of the file cited.
103
103
  attr_accessor filename: String
104
104
 
105
- # The index of the file in the list of files.
105
+ # The index in the output text at which to insert the file citation.
106
106
  attr_accessor index: Integer
107
107
 
108
108
  # The type of the file citation. Always `file_citation`.
@@ -113,7 +113,7 @@ module OpenAI
113
113
  # @param filename
114
114
  # The filename of the file cited.
115
115
  # @param index
116
- # The index of the file in the list of files.
116
+ # The index in the output text at which to insert the file citation.
117
117
  # @param type
118
118
  # The type of the file citation. Always `file_citation`.
119
119
  def initialize: (
@@ -32,6 +32,7 @@ module OpenAI
32
32
  plugins: ::Array[OpenAI::Beta::HostedPlugin],
33
33
  skills: ::Array[OpenAI::Models::Beta::hosted_skill],
34
34
  ?type: :openai_hosted,
35
+ ?container_size: OpenAI::Models::Beta::Environment::OpenAIHosted::container_size?,
35
36
  ?desktop: OpenAI::Beta::Environment::OpenAIHosted::Desktop
36
37
  }
37
38
 
@@ -60,6 +61,10 @@ module OpenAI
60
61
  # The type of the object. Always `openai_hosted`.
61
62
  attr_accessor type: :openai_hosted
62
63
 
64
+ # The effective CPU and memory tier, or null when unknown or outside the public
65
+ # tiers.
66
+ attr_accessor container_size: OpenAI::Models::Beta::Environment::OpenAIHosted::container_size?
67
+
63
68
  # The effective desktop configuration.
64
69
  attr_reader desktop: OpenAI::Beta::Environment::OpenAIHosted::Desktop?
65
70
 
@@ -82,6 +87,9 @@ module OpenAI
82
87
  # Plugins installed in the environment, excluding their archive contents.
83
88
  # @param skills
84
89
  # Skills installed in the environment, excluding their archive contents.
90
+ # @param container_size
91
+ # The effective CPU and memory tier, or null when unknown or outside the public
92
+ # tiers.
85
93
  # @param desktop
86
94
  # The effective desktop configuration.
87
95
  # @param type
@@ -94,6 +102,7 @@ module OpenAI
94
102
  packages: OpenAI::Beta::Environment::OpenAIHosted::Packages,
95
103
  plugins: ::Array[OpenAI::Beta::HostedPlugin],
96
104
  skills: ::Array[OpenAI::Models::Beta::hosted_skill],
105
+ ?container_size: OpenAI::Models::Beta::Environment::OpenAIHosted::container_size?,
97
106
  ?desktop: OpenAI::Beta::Environment::OpenAIHosted::Desktop,
98
107
  ?type: :openai_hosted
99
108
  ) -> void
@@ -107,6 +116,7 @@ module OpenAI
107
116
  plugins: ::Array[OpenAI::Beta::HostedPlugin],
108
117
  skills: ::Array[OpenAI::Models::Beta::hosted_skill],
109
118
  ?type: :openai_hosted,
119
+ ?container_size: OpenAI::Models::Beta::Environment::OpenAIHosted::container_size?,
110
120
  ?desktop: OpenAI::Beta::Environment::OpenAIHosted::Desktop
111
121
  }
112
122
 
@@ -191,6 +201,18 @@ module OpenAI
191
201
  }
192
202
  end
193
203
 
204
+ type container_size = :small | :medium | :large
205
+
206
+ module ContainerSize
207
+ extend OpenAI::Internal::Type::Enum
208
+
209
+ SMALL: :small
210
+ MEDIUM: :medium
211
+ LARGE: :large
212
+
213
+ def self?.values: -> ::Array[OpenAI::Models::Beta::Environment::OpenAIHosted::container_size]
214
+ end
215
+
194
216
  type desktop = { enabled: bool }
195
217
 
196
218
  class Desktop < OpenAI::Internal::Type::BaseModel
@@ -26,6 +26,7 @@ module OpenAI
26
26
  {
27
27
  ?type: :openai_hosted,
28
28
  ?capability_directories: ::Array[String]?,
29
+ ?container_size: OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size,
29
30
  ?desktop: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop?,
30
31
  ?env: ::Hash[Symbol, String]?,
31
32
  ?environment_template_id: String,
@@ -45,6 +46,14 @@ module OpenAI
45
46
  # list.
46
47
  attr_accessor capability_directories: ::Array[String]?
47
48
 
49
+ # The hosted container size. Omission selects the medium tier.
50
+ attr_reader container_size: OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size?
51
+
52
+ # The hosted container size. Omission selects the medium tier.
53
+ def container_size=: (
54
+ OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size
55
+ ) -> OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size
56
+
48
57
  # Desktop provisioning. Omission or null inherits the template setting, or
49
58
  # defaults to disabled.
50
59
  attr_accessor desktop: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop?
@@ -83,6 +92,8 @@ module OpenAI
83
92
  # @param capability_directories
84
93
  # Directories that contain capabilities exposed to the agent. Defaults to an empty
85
94
  # list.
95
+ # @param container_size
96
+ # The hosted container size. Omission selects the medium tier.
86
97
  # @param desktop
87
98
  # Desktop provisioning. Omission or null inherits the template setting, or
88
99
  # defaults to disabled.
@@ -109,6 +120,7 @@ module OpenAI
109
120
  # The type of the object. Always `openai_hosted`.
110
121
  def initialize: (
111
122
  ?capability_directories: ::Array[String]?,
123
+ ?container_size: OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size,
112
124
  ?desktop: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop?,
113
125
  ?env: ::Hash[Symbol, String]?,
114
126
  ?environment_template_id: String,
@@ -124,6 +136,7 @@ module OpenAI
124
136
  def to_hash: -> {
125
137
  ?type: :openai_hosted,
126
138
  ?capability_directories: ::Array[String]?,
139
+ ?container_size: OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size,
127
140
  ?desktop: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop?,
128
141
  ?env: ::Hash[Symbol, String]?,
129
142
  ?environment_template_id: String,
@@ -135,6 +148,18 @@ module OpenAI
135
148
  ?skills: ::Array[OpenAI::Models::Beta::hosted_skill_param]?
136
149
  }
137
150
 
151
+ type container_size = :small | :medium | :large
152
+
153
+ module ContainerSize
154
+ extend OpenAI::Internal::Type::Enum
155
+
156
+ SMALL: :small
157
+ MEDIUM: :medium
158
+ LARGE: :large
159
+
160
+ def self?.values: -> ::Array[OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size]
161
+ end
162
+
138
163
  type desktop = { enabled: bool }
139
164
 
140
165
  class Desktop < OpenAI::Internal::Type::BaseModel
@@ -31,6 +31,7 @@ module OpenAI
31
31
  | :usage_limit_exceeded
32
32
  | :credit_balance_exhausted
33
33
  | :rate_limit_exceeded
34
+ | :flex_unavailable
34
35
  | :server_overloaded
35
36
  | :cyber_policy
36
37
  | :misalignment_policy_violation
@@ -63,6 +64,9 @@ module OpenAI
63
64
  # The request exceeds the available rate limit.
64
65
  RATE_LIMIT_EXCEEDED: :rate_limit_exceeded
65
66
 
67
+ # Flex processing is temporarily unavailable.
68
+ FLEX_UNAVAILABLE: :flex_unavailable
69
+
66
70
  # The model service is temporarily overloaded.
67
71
  SERVER_OVERLOADED: :server_overloaded
68
72
 
@@ -81,7 +81,7 @@ module OpenAI
81
81
  ?detail: OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::detail
82
82
  }
83
83
 
84
- type detail = :auto | :low | :high
84
+ type detail = :auto | :low | :high | :original
85
85
 
86
86
  module Detail
87
87
  extend OpenAI::Internal::Type::Enum
@@ -89,6 +89,7 @@ module OpenAI
89
89
  AUTO: :auto
90
90
  LOW: :low
91
91
  HIGH: :high
92
+ ORIGINAL: :original
92
93
 
93
94
  def self?.values: -> ::Array[OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL::detail]
94
95
  end
@@ -81,7 +81,12 @@ module OpenAI
81
81
  end
82
82
 
83
83
  type transport_dtmf_send =
84
- { event: String, event_id: String, ?type: :"transport.dtmf.send" }
84
+ {
85
+ event: String,
86
+ event_id: String,
87
+ ?type: :"transport.dtmf.send",
88
+ ?client_event_id: String
89
+ }
85
90
 
86
91
  class TransportDtmfSend < OpenAI::Internal::Type::BaseModel
87
92
  attr_accessor event: String
@@ -90,16 +95,26 @@ module OpenAI
90
95
 
91
96
  attr_accessor type: :"transport.dtmf.send"
92
97
 
98
+ # The event_id of the client command, when supplied.
99
+ attr_reader client_event_id: String?
100
+
101
+ # The event_id of the client command, when supplied.
102
+ def client_event_id=: (String) -> String
103
+
104
+ # @param client_event_id
105
+ # The event_id of the client command, when supplied.
93
106
  def initialize: (
94
107
  event: String,
95
108
  event_id: String,
109
+ ?client_event_id: String,
96
110
  ?type: :"transport.dtmf.send"
97
111
  ) -> void
98
112
 
99
113
  def to_hash: -> {
100
114
  event: String,
101
115
  event_id: String,
102
- ?type: :"transport.dtmf.send"
116
+ ?type: :"transport.dtmf.send",
117
+ ?client_event_id: String
103
118
  }
104
119
  end
105
120
 
@@ -81,7 +81,12 @@ module OpenAI
81
81
  end
82
82
 
83
83
  type transport_dtmf_send =
84
- { event: String, event_id: String, ?type: :"transport.dtmf.send" }
84
+ {
85
+ event: String,
86
+ event_id: String,
87
+ ?type: :"transport.dtmf.send",
88
+ ?client_event_id: String
89
+ }
85
90
 
86
91
  class TransportDtmfSend < OpenAI::Internal::Type::BaseModel
87
92
  attr_accessor event: String
@@ -90,16 +95,26 @@ module OpenAI
90
95
 
91
96
  attr_accessor type: :"transport.dtmf.send"
92
97
 
98
+ # The event_id of the client command, when supplied.
99
+ attr_reader client_event_id: String?
100
+
101
+ # The event_id of the client command, when supplied.
102
+ def client_event_id=: (String) -> String
103
+
104
+ # @param client_event_id
105
+ # The event_id of the client command, when supplied.
93
106
  def initialize: (
94
107
  event: String,
95
108
  event_id: String,
109
+ ?client_event_id: String,
96
110
  ?type: :"transport.dtmf.send"
97
111
  ) -> void
98
112
 
99
113
  def to_hash: -> {
100
114
  event: String,
101
115
  event_id: String,
102
- ?type: :"transport.dtmf.send"
116
+ ?type: :"transport.dtmf.send",
117
+ ?client_event_id: String
103
118
  }
104
119
  end
105
120
 
@@ -0,0 +1,39 @@
1
+ module OpenAI
2
+ module Models
3
+ module Realtime
4
+ module Translations
5
+ type client_secret_create_params =
6
+ {
7
+ session: OpenAI::Realtime::RealtimeTranslationSessionCreateRequest,
8
+ ?expires_after: OpenAI::Realtime::RealtimeTranslationClientSecretCreateRequest::ExpiresAfter,
9
+ ?request_options: OpenAI::request_opts
10
+ }
11
+
12
+ class ClientSecretCreateParams < OpenAI::Models::Realtime::RealtimeTranslationClientSecretCreateRequest
13
+ extend OpenAI::Internal::Type::RequestParameters::Converter
14
+ include OpenAI::Internal::Type::RequestParameters
15
+
16
+ # @param session
17
+ # Realtime translation session configuration. Translation sessions stream source
18
+ # audio in and translated audio plus transcript deltas out continuously.
19
+ # @param expires_after
20
+ # Configuration for the client secret expiration. Expiration refers to the time
21
+ # after which a client secret will no longer be valid for creating sessions. The
22
+ # session itself may continue after that time once started. A secret can be used
23
+ # to create multiple sessions until it expires.
24
+ def initialize: (
25
+ session: OpenAI::Realtime::RealtimeTranslationSessionCreateRequest,
26
+ ?expires_after: OpenAI::Realtime::RealtimeTranslationClientSecretCreateRequest::ExpiresAfter,
27
+ ?request_options: OpenAI::request_opts
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ session: OpenAI::Realtime::RealtimeTranslationSessionCreateRequest,
32
+ ?expires_after: OpenAI::Realtime::RealtimeTranslationClientSecretCreateRequest::ExpiresAfter,
33
+ ?request_options: OpenAI::RequestOptions
34
+ }
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -69,7 +69,7 @@ module OpenAI
69
69
  # The filename of the file cited.
70
70
  attr_accessor filename: String
71
71
 
72
- # The index of the file in the list of files.
72
+ # The index in the output text at which to insert the file citation.
73
73
  attr_accessor index: Integer
74
74
 
75
75
  # The type of the file citation. Always `file_citation`.
@@ -80,7 +80,7 @@ module OpenAI
80
80
  # @param filename
81
81
  # The filename of the file cited.
82
82
  # @param index
83
- # The index of the file in the list of files.
83
+ # The index in the output text at which to insert the file citation.
84
84
  # @param type
85
85
  # The type of the file citation. Always `file_citation`.
86
86
  def initialize: (
@@ -92,7 +92,7 @@ module OpenAI
92
92
  # The filename of the file cited.
93
93
  attr_accessor filename: String
94
94
 
95
- # The index of the file in the list of files.
95
+ # The index in the output text at which to insert the file citation.
96
96
  attr_accessor index: Integer
97
97
 
98
98
  # The type of the file citation. Always `file_citation`.
@@ -103,7 +103,7 @@ module OpenAI
103
103
  # @param filename
104
104
  # The filename of the file cited.
105
105
  # @param index
106
- # The index of the file in the list of files.
106
+ # The index in the output text at which to insert the file citation.
107
107
  # @param type
108
108
  # The type of the file citation. Always `file_citation`.
109
109
  def initialize: (
@@ -4,6 +4,23 @@ module OpenAI
4
4
  class Agents
5
5
  class Environments
6
6
  class Files
7
+ # Beta file helpers.
8
+ def prepare: (
9
+ Hash[String, String | Pathname] files,
10
+ ?request_options: OpenAI::request_opts
11
+ ) -> OpenAI::Helpers::Beta::Agents::PreparedFiles
12
+ def prepare_directory: (
13
+ String | Pathname directory,
14
+ destination: String,
15
+ include: Array[String],
16
+ ?request_options: OpenAI::request_opts
17
+ ) -> OpenAI::Helpers::Beta::Agents::PreparedFiles
18
+ def upload: (
19
+ String environment_id,
20
+ file: String | Pathname,
21
+ path: String,
22
+ ?request_options: OpenAI::request_opts
23
+ ) -> OpenAI::Helpers::Beta::Agents::PreparedFiles
7
24
  def create: (
8
25
  String environment_id,
9
26
  hosted_environment_file_param: OpenAI::Models::Beta::hosted_environment_file_param,
@@ -4,6 +4,10 @@ module OpenAI
4
4
  class Agents
5
5
  class Sessions
6
6
  class Artifacts
7
+ # Beta result-scoped downloads.
8
+ def for_result: (
9
+ OpenAI::Helpers::Beta::Agents::TurnResult result
10
+ ) -> OpenAI::Helpers::Beta::Agents::ResultArtifacts
7
11
  def retrieve: (
8
12
  String artifact_id,
9
13
  session_id: String,
@@ -0,0 +1,21 @@
1
+ module OpenAI
2
+ module Resources
3
+ class Beta
4
+ class Agents
5
+ class Sessions
6
+ class Traces
7
+ def list: (
8
+ String session_id,
9
+ ?after: String,
10
+ ?limit: Integer,
11
+ ?order: OpenAI::Models::Beta::Agents::Sessions::TraceListParams::order,
12
+ ?request_options: OpenAI::request_opts
13
+ ) -> OpenAI::Internal::CursorPage[OpenAI::Beta::Agents::Sessions::SessionTrace]
14
+
15
+ def initialize: (client: OpenAI::Client) -> void
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -11,6 +11,8 @@ module OpenAI
11
11
 
12
12
  attr_reader events: OpenAI::Resources::Beta::Agents::Sessions::Events
13
13
 
14
+ attr_reader traces: OpenAI::Resources::Beta::Agents::Sessions::Traces
15
+
14
16
  attr_reader turns: OpenAI::Resources::Beta::Agents::Sessions::Turns
15
17
 
16
18
  def create: (
@@ -27,11 +29,12 @@ module OpenAI
27
29
  environment: OpenAI::Models::Beta::environment_param,
28
30
  ?agent: OpenAI::Beta::Agents::SessionCreateParams::Agent,
29
31
  ?agent_id: String,
32
+ ?output_type: singleton(OpenAI::Helpers::StructuredOutput::BaseModel)?,
30
33
  ?input: OpenAI::Models::Beta::Agents::SessionCreateParams::input?,
31
34
  ?metadata: ::Hash[Symbol, String]?,
32
35
  ?vault_ids: ::Array[String]?,
33
36
  ?request_options: OpenAI::request_opts
34
- ) -> OpenAI::Internal::Stream[OpenAI::Models::Beta::agent_session_event]
37
+ ) -> OpenAI::Helpers::Beta::Agents::CreationStream
35
38
 
36
39
  def retrieve: (
37
40
  String session_id,
@@ -0,0 +1,17 @@
1
+ module OpenAI
2
+ module Resources
3
+ class Realtime
4
+ class Translations
5
+ class ClientSecrets
6
+ def create: (
7
+ session: OpenAI::Realtime::RealtimeTranslationSessionCreateRequest,
8
+ ?expires_after: OpenAI::Realtime::RealtimeTranslationClientSecretCreateRequest::ExpiresAfter,
9
+ ?request_options: OpenAI::request_opts
10
+ ) -> OpenAI::Realtime::RealtimeTranslationClientSecretCreateResponse
11
+
12
+ def initialize: (client: OpenAI::Client) -> void
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ module OpenAI
2
+ module Resources
3
+ class Realtime
4
+ class Translations
5
+ attr_reader client_secrets: OpenAI::Resources::Realtime::Translations::ClientSecrets
6
+
7
+ def initialize: (client: OpenAI::Client) -> void
8
+ end
9
+ end
10
+ end
11
+ end
@@ -5,6 +5,8 @@ module OpenAI
5
5
 
6
6
  attr_reader calls: OpenAI::Resources::Realtime::Calls
7
7
 
8
+ attr_reader translations: OpenAI::Resources::Realtime::Translations
9
+
8
10
  def initialize: (client: OpenAI::Client) -> void
9
11
  end
10
12
  end