openai 0.127.0 → 0.128.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 +17 -0
- data/README.md +1 -1
- data/lib/openai/helpers/agents/session_stream.rb +8 -3
- data/lib/openai/helpers/beta/agents/result.rb +12 -4
- data/lib/openai/models/beta/agent_session.rb +1 -43
- data/lib/openai/models/beta/agent_session_event.rb +1 -4
- data/lib/openai/models/beta/agents/session_create_params.rb +1 -33
- data/lib/openai/models/beta/agents/session_update_params.rb +1 -33
- data/lib/openai/models/beta/session_turn_error.rb +0 -3
- data/lib/openai/models/csam_moderation.rb +131 -0
- data/lib/openai/models/csam_moderation_response.rb +27 -0
- data/lib/openai/models/live/mcp_require_approval_filter.rb +28 -0
- data/lib/openai/models/live/mcp_tool.rb +181 -0
- data/lib/openai/models/live/mcp_tool_filter.rb +28 -0
- data/lib/openai/models/live/responses_delegation_config.rb +7 -14
- data/lib/openai/models/live/responses_delegation_update_config.rb +7 -14
- data/lib/openai/models.rb +4 -0
- data/lib/openai/resources/beta/agents/sessions/events.rb +1 -1
- data/lib/openai/resources/beta/agents/sessions.rb +3 -15
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +5 -1
- data/rbi/openai/models/beta/agent_session.rbi +1 -70
- data/rbi/openai/models/beta/agent_session_event.rbi +0 -1
- data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -56
- data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -56
- data/rbi/openai/models/beta/session_turn_error.rbi +0 -3
- data/rbi/openai/models/csam_moderation.rbi +248 -0
- data/rbi/openai/models/csam_moderation_response.rbi +56 -0
- data/rbi/openai/models/live/mcp_require_approval_filter.rbi +64 -0
- data/rbi/openai/models/live/mcp_tool.rbi +253 -0
- data/rbi/openai/models/live/mcp_tool_filter.rbi +58 -0
- data/rbi/openai/models/live/responses_delegation_config.rbi +7 -39
- data/rbi/openai/models/live/responses_delegation_update_config.rbi +7 -39
- data/rbi/openai/models.rbi +4 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +0 -12
- data/sig/openai/models/beta/agent_session.rbs +3 -44
- data/sig/openai/models/beta/agent_session_event.rbs +0 -1
- data/sig/openai/models/beta/agents/session_create_params.rbs +0 -23
- data/sig/openai/models/beta/agents/session_update_params.rbs +0 -23
- data/sig/openai/models/beta/session_turn_error.rbs +0 -4
- data/sig/openai/models/csam_moderation.rbs +113 -0
- data/sig/openai/models/csam_moderation_response.rbs +30 -0
- data/sig/openai/models/live/mcp_require_approval_filter.rbs +33 -0
- data/sig/openai/models/live/mcp_tool.rbs +159 -0
- data/sig/openai/models/live/mcp_tool_filter.rbs +27 -0
- data/sig/openai/models/live/responses_delegation_config.rbs +5 -11
- data/sig/openai/models/live/responses_delegation_update_config.rbs +5 -11
- data/sig/openai/models.rbs +4 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +0 -3
- metadata +16 -4
- data/lib/openai/models/beta/agent_session_budget_reached_event.rb +0 -48
- data/rbi/openai/models/beta/agent_session_budget_reached_event.rbi +0 -83
- data/sig/openai/models/beta/agent_session_budget_reached_event.rbs +0 -52
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2685ed31f7361e4f75075fcb357f5c61a63c2352d4c1d02a8ad17c097c05186c
|
|
4
|
+
data.tar.gz: 31e65b671177373c6eb104cf5a1a389f20fd5fe029e64b73badb74151571d410
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 763b7d3d9e4e9c880daab8ccb7f20ac8e17c02c0cdf2da2af13381d3e151447a434c6ab793d6af17859bab21bd1dc50517ae4859203acd52fbffc41a134abd10
|
|
7
|
+
data.tar.gz: 496512838fce02e49affa4dc433eadce1b35f47693b1e14704314d55a6acaaa820ac80aef8fe1ad1ad8d921150e66ed60a5be44a67aba7372582a9caece3f5c8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.128.0](https://github.com/openai/openai-ruby/compare/v0.127.0...v0.128.0) (2026-11-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** add Live MCP server configuration ([#1070](https://github.com/openai/openai-ruby/issues/1070)) ([57eb631](https://github.com/openai/openai-ruby/commit/57eb631064d53686f179750a16f4d792b91d3e49))
|
|
9
|
+
* **api:** add standalone CSAM moderation models ([#1079](https://github.com/openai/openai-ruby/issues/1079)) ([40f8422](https://github.com/openai/openai-ruby/commit/40f84227a8bfea555ff3b17ed2d2233cf6a7f1b2))
|
|
10
|
+
* **api:** hide Managed Agents session budget controls and events ([#1078](https://github.com/openai/openai-ruby/issues/1078)) ([7c181cf](https://github.com/openai/openai-ruby/commit/7c181cfcb3d00fd287ba03e69ae0f390aa238d6f))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Chores
|
|
14
|
+
|
|
15
|
+
* **deps-dev:** bump addressable from 2.9.0 to 2.9.1 ([#1065](https://github.com/openai/openai-ruby/issues/1065)) ([ebd877e](https://github.com/openai/openai-ruby/commit/ebd877e4541e217c5d91a907b0f3d707da5722bd))
|
|
16
|
+
* **deps-dev:** bump the development-dependencies group across 1 directory with 5 updates ([#1066](https://github.com/openai/openai-ruby/issues/1066)) ([a2e764a](https://github.com/openai/openai-ruby/commit/a2e764a8c08394e2709cc3b753866fd41fdc6201))
|
|
17
|
+
* **deps:** bump ruby/setup-ruby from 1.338.0 to 1.341.0 ([#1081](https://github.com/openai/openai-ruby/issues/1081)) ([ea3baea](https://github.com/openai/openai-ruby/commit/ea3baeac1ef6afee38191697fba8b02848823098))
|
|
18
|
+
* **deps:** bump rubygems/release-gem from 1.4.1 to 1.4.2 ([#1067](https://github.com/openai/openai-ruby/issues/1067)) ([6890aed](https://github.com/openai/openai-ruby/commit/6890aeda0ecc09d7df9d3781f91c19c35bc5f93f))
|
|
19
|
+
|
|
3
20
|
## [0.127.0](https://github.com/openai/openai-ruby/compare/v0.126.0...v0.127.0) (2026-11-17)
|
|
4
21
|
|
|
5
22
|
|
data/README.md
CHANGED
|
@@ -155,14 +155,19 @@ module OpenAI
|
|
|
155
155
|
|
|
156
156
|
@collector.observe(event)
|
|
157
157
|
unless known
|
|
158
|
+
terminal = event.is_a?(Hash) &&
|
|
159
|
+
event[:type] == "agent.session.budget_reached" &&
|
|
160
|
+
event[:session].is_a?(Hash) &&
|
|
161
|
+
event[:session][:id].is_a?(String) &&
|
|
162
|
+
event[:session][:id] == @session_id &&
|
|
163
|
+
(@turn_id.nil? || @turn_ended)
|
|
164
|
+
close if terminal
|
|
158
165
|
yielder << event
|
|
166
|
+
break if terminal || @closed
|
|
159
167
|
next
|
|
160
168
|
end
|
|
161
169
|
|
|
162
170
|
terminal = event.type == :"agent.session.failed" ||
|
|
163
|
-
(event.type == :"agent.session.budget_reached" &&
|
|
164
|
-
event.session.id == @session_id &&
|
|
165
|
-
(@turn_id.nil? || @turn_ended)) ||
|
|
166
171
|
(event.type == :"agent.session.idle" && @turn_ended)
|
|
167
172
|
invocation = @dispatcher.prepare_call(event) unless terminal
|
|
168
173
|
close if terminal
|
|
@@ -69,7 +69,18 @@ module OpenAI
|
|
|
69
69
|
def observe(event)
|
|
70
70
|
@started = true
|
|
71
71
|
return unless @enabled
|
|
72
|
-
return if @finished
|
|
72
|
+
return if @finished
|
|
73
|
+
unless event.is_a?(OpenAI::Internal::Type::BaseModel)
|
|
74
|
+
if event.is_a?(Hash) && event[:type] == "agent.session.budget_reached" && event[:session].is_a?(Hash)
|
|
75
|
+
session_id = event[:session][:id]
|
|
76
|
+
if session_id.is_a?(String)
|
|
77
|
+
@session_id ||= session_id.dup
|
|
78
|
+
@finished = true if (@turn.nil? || @terminal) && session_id == @session_id
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
return
|
|
83
|
+
end
|
|
73
84
|
|
|
74
85
|
case event.type
|
|
75
86
|
when :"agent.session.created"
|
|
@@ -114,9 +125,6 @@ module OpenAI
|
|
|
114
125
|
@required_actions = [] if event.session.id == @session_id
|
|
115
126
|
when :"agent.session.idle"
|
|
116
127
|
@finished = true if @terminal && event.session.id == @session_id
|
|
117
|
-
when :"agent.session.budget_reached"
|
|
118
|
-
@session_id ||= event.session.id.dup
|
|
119
|
-
@finished = true if (@turn.nil? || @terminal) && event.session.id == @session_id
|
|
120
128
|
when :"agent.session.failed"
|
|
121
129
|
@session_id ||= event.session.id.dup
|
|
122
130
|
@failure = :failed
|
|
@@ -93,15 +93,7 @@ module OpenAI
|
|
|
93
93
|
# @return [Symbol, OpenAI::Models::Beta::AgentSession::Review, nil]
|
|
94
94
|
optional :review, enum: -> { OpenAI::Beta::AgentSession::Review }
|
|
95
95
|
|
|
96
|
-
# @!
|
|
97
|
-
# Spending limit and best-effort consumption, in USD cents. Present when
|
|
98
|
-
# spending-control visibility is enabled; limit is null without a cap. Older
|
|
99
|
-
# server responses may omit this object.
|
|
100
|
-
#
|
|
101
|
-
# @return [OpenAI::Models::Beta::AgentSession::SpendControl, nil]
|
|
102
|
-
optional :spend_control, -> { OpenAI::Beta::AgentSession::SpendControl }
|
|
103
|
-
|
|
104
|
-
# @!method initialize(id:, agent:, created_at:, environment:, error:, last_active_at:, metadata:, required_actions:, status:, usage:, vault_ids:, prompt_cache_options: nil, review: nil, spend_control: nil, object: :"agent.session")
|
|
96
|
+
# @!method initialize(id:, agent:, created_at:, environment:, error:, last_active_at:, metadata:, required_actions:, status:, usage:, vault_ids:, prompt_cache_options: nil, review: nil, object: :"agent.session")
|
|
105
97
|
# A Managed Agents session.
|
|
106
98
|
#
|
|
107
99
|
# @param id [String]
|
|
@@ -145,11 +137,6 @@ module OpenAI
|
|
|
145
137
|
# Review applied to eligible actions in this session. Omitted when review is none
|
|
146
138
|
# and automatic review is not enabled. Omission means none.
|
|
147
139
|
#
|
|
148
|
-
# @param spend_control [OpenAI::Models::Beta::AgentSession::SpendControl]
|
|
149
|
-
# Spending limit and best-effort consumption, in USD cents. Present when
|
|
150
|
-
# spending-control visibility is enabled; limit is null without a cap. Older
|
|
151
|
-
# server responses may omit this object.
|
|
152
|
-
#
|
|
153
140
|
# @param object [Symbol, :"agent.session"]
|
|
154
141
|
# The object type. Always `agent.session`.
|
|
155
142
|
|
|
@@ -751,9 +738,6 @@ module OpenAI
|
|
|
751
738
|
# The session failed.
|
|
752
739
|
FAILED = :failed
|
|
753
740
|
|
|
754
|
-
# The session is paused because its spending limit was reached.
|
|
755
|
-
BUDGET_REACHED = :budget_reached
|
|
756
|
-
|
|
757
741
|
# @!method self.values
|
|
758
742
|
# @return [Array<Symbol>]
|
|
759
743
|
end
|
|
@@ -795,32 +779,6 @@ module OpenAI
|
|
|
795
779
|
# @!method self.values
|
|
796
780
|
# @return [Array<Symbol>]
|
|
797
781
|
end
|
|
798
|
-
|
|
799
|
-
# @see OpenAI::Models::Beta::AgentSession#spend_control
|
|
800
|
-
class SpendControl < OpenAI::Internal::Type::BaseModel
|
|
801
|
-
# @!attribute consumed
|
|
802
|
-
# Best-effort recorded spend floored to whole USD cents, or null when unavailable.
|
|
803
|
-
#
|
|
804
|
-
# @return [Integer, nil]
|
|
805
|
-
required :consumed, Integer, nil?: true
|
|
806
|
-
|
|
807
|
-
# @!attribute limit
|
|
808
|
-
# The configured positive limit in USD cents, or null when unlimited.
|
|
809
|
-
#
|
|
810
|
-
# @return [Integer, nil]
|
|
811
|
-
required :limit, Integer, nil?: true
|
|
812
|
-
|
|
813
|
-
# @!method initialize(consumed:, limit:)
|
|
814
|
-
# Spending limit and best-effort consumption, in USD cents. Present when
|
|
815
|
-
# spending-control visibility is enabled; limit is null without a cap. Older
|
|
816
|
-
# server responses may omit this object.
|
|
817
|
-
#
|
|
818
|
-
# @param consumed [Integer, nil]
|
|
819
|
-
# Best-effort recorded spend floored to whole USD cents, or null when unavailable.
|
|
820
|
-
#
|
|
821
|
-
# @param limit [Integer, nil]
|
|
822
|
-
# The configured positive limit in USD cents, or null when unlimited.
|
|
823
|
-
end
|
|
824
782
|
end
|
|
825
783
|
end
|
|
826
784
|
end
|
|
@@ -54,9 +54,6 @@ module OpenAI
|
|
|
54
54
|
# Emitted when a session becomes idle.
|
|
55
55
|
variant :"agent.session.idle", -> { OpenAI::Beta::AgentSessionIdleEvent }
|
|
56
56
|
|
|
57
|
-
# Emitted when a session pauses because its spending limit was reached.
|
|
58
|
-
variant :"agent.session.budget_reached", -> { OpenAI::Beta::AgentSessionBudgetReachedEvent }
|
|
59
|
-
|
|
60
57
|
# Emitted when a session starts processing a turn.
|
|
61
58
|
variant :"agent.session.in_progress", -> { OpenAI::Beta::AgentSessionInProgressEvent }
|
|
62
59
|
|
|
@@ -133,7 +130,7 @@ module OpenAI
|
|
|
133
130
|
)
|
|
134
131
|
|
|
135
132
|
# @!method self.variants
|
|
136
|
-
# @return [Array(OpenAI::Models::Beta::AgentSessionErrorEvent, OpenAI::Models::Beta::AgentSessionEnvironmentReadyEvent, OpenAI::Models::Beta::AgentSessionEnvironmentSuspendedEvent, OpenAI::Models::Beta::AgentSessionEnvironmentExpiredEvent, OpenAI::Models::Beta::AgentSessionEnvironmentResetEvent, OpenAI::Models::Beta::AgentOutputCommandExecutionOutputDeltaEvent, OpenAI::Models::Beta::AgentSessionCreatedEvent, OpenAI::Models::Beta::AgentSessionTurnCreatedEvent, OpenAI::Models::Beta::AgentSessionTurnInProgressEvent, OpenAI::Models::Beta::AgentSessionTurnCompletedEvent, OpenAI::Models::Beta::AgentSessionTurnFailedEvent, OpenAI::Models::Beta::AgentSessionTurnCancelledEvent, OpenAI::Models::Beta::AgentSessionTurnItemAddedEvent, OpenAI::Models::Beta::AgentSessionIdleEvent, OpenAI::Models::Beta::
|
|
133
|
+
# @return [Array(OpenAI::Models::Beta::AgentSessionErrorEvent, OpenAI::Models::Beta::AgentSessionEnvironmentReadyEvent, OpenAI::Models::Beta::AgentSessionEnvironmentSuspendedEvent, OpenAI::Models::Beta::AgentSessionEnvironmentExpiredEvent, OpenAI::Models::Beta::AgentSessionEnvironmentResetEvent, OpenAI::Models::Beta::AgentOutputCommandExecutionOutputDeltaEvent, OpenAI::Models::Beta::AgentSessionCreatedEvent, OpenAI::Models::Beta::AgentSessionTurnCreatedEvent, OpenAI::Models::Beta::AgentSessionTurnInProgressEvent, OpenAI::Models::Beta::AgentSessionTurnCompletedEvent, OpenAI::Models::Beta::AgentSessionTurnFailedEvent, OpenAI::Models::Beta::AgentSessionTurnCancelledEvent, OpenAI::Models::Beta::AgentSessionTurnItemAddedEvent, OpenAI::Models::Beta::AgentSessionIdleEvent, OpenAI::Models::Beta::AgentSessionInProgressEvent, OpenAI::Models::Beta::AgentSessionRequiresActionEvent, OpenAI::Models::Beta::AgentSessionFailedEvent, OpenAI::Models::Beta::AgentSessionEnvironmentPendingEvent, OpenAI::Models::Beta::AgentSessionEnvironmentConnectedEvent, OpenAI::Models::Beta::AgentSessionEnvironmentDisconnectedEvent, OpenAI::Models::Beta::AgentSessionEnvironmentFailedEvent, OpenAI::Models::Beta::AgentSessionSubagentCreatedEvent, OpenAI::Models::Beta::AgentSessionSubagentActiveEvent, OpenAI::Models::Beta::AgentSessionSubagentClosedEvent, OpenAI::Models::Beta::AgentSessionTurnItemDoneEvent, OpenAI::Models::Beta::AgentSessionTurnContentPartAddedEvent, OpenAI::Models::Beta::AgentSessionTurnContentPartDoneEvent, OpenAI::Models::Beta::AgentSessionTurnOutputTextDeltaEvent, OpenAI::Models::Beta::AgentSessionTurnOutputTextDoneEvent, OpenAI::Models::Beta::AgentSessionTurnReasoningSummaryPartAddedEvent, OpenAI::Models::Beta::AgentSessionTurnReasoningSummaryPartDoneEvent, OpenAI::Models::Beta::AgentSessionTurnReasoningSummaryTextDeltaEvent, OpenAI::Models::Beta::AgentSessionTurnReasoningSummaryTextDoneEvent)]
|
|
137
134
|
end
|
|
138
135
|
end
|
|
139
136
|
end
|
|
@@ -64,19 +64,6 @@ module OpenAI
|
|
|
64
64
|
# @return [Symbol, OpenAI::Models::Beta::Agents::SessionCreateParams::Review, nil]
|
|
65
65
|
optional :review, enum: -> { OpenAI::Beta::Agents::SessionCreateParams::Review }
|
|
66
66
|
|
|
67
|
-
# @!attribute spend_control
|
|
68
|
-
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
69
|
-
# session.
|
|
70
|
-
#
|
|
71
|
-
# @return [OpenAI::Models::Beta::Agents::SessionCreateParams::SpendControl, nil]
|
|
72
|
-
optional(
|
|
73
|
-
:spend_control,
|
|
74
|
-
-> {
|
|
75
|
-
OpenAI::Beta::Agents::SessionCreateParams::SpendControl
|
|
76
|
-
},
|
|
77
|
-
nil?: true
|
|
78
|
-
)
|
|
79
|
-
|
|
80
67
|
# @!attribute stream_options
|
|
81
68
|
# Options for the event stream. Only allowed when `stream` is `true`.
|
|
82
69
|
#
|
|
@@ -89,7 +76,7 @@ module OpenAI
|
|
|
89
76
|
# @return [Array<String>, nil]
|
|
90
77
|
optional :vault_ids, OpenAI::Internal::Type::ArrayOf[String], nil?: true
|
|
91
78
|
|
|
92
|
-
# @!method initialize(environment:, agent: nil, agent_id: nil, input: nil, metadata: nil, prompt_cache_options: nil, review: nil,
|
|
79
|
+
# @!method initialize(environment:, agent: nil, agent_id: nil, input: nil, metadata: nil, prompt_cache_options: nil, review: nil, stream_options: nil, vault_ids: nil, request_options: {})
|
|
93
80
|
# @param environment [OpenAI::Models::Beta::EnvironmentParam::None, OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted, OpenAI::Models::Beta::EnvironmentParam::SelfHosted]
|
|
94
81
|
# An inline execution environment or a reference to an environment template.
|
|
95
82
|
#
|
|
@@ -118,10 +105,6 @@ module OpenAI
|
|
|
118
105
|
# @param review [Symbol, OpenAI::Models::Beta::Agents::SessionCreateParams::Review]
|
|
119
106
|
# Action review mode. Omit to use none.
|
|
120
107
|
#
|
|
121
|
-
# @param spend_control [OpenAI::Models::Beta::Agents::SessionCreateParams::SpendControl, nil]
|
|
122
|
-
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
123
|
-
# session.
|
|
124
|
-
#
|
|
125
108
|
# @param stream_options [OpenAI::Models::Beta::Agents::SessionCreateParams::StreamOptions]
|
|
126
109
|
# Options for the event stream. Only allowed when `stream` is `true`.
|
|
127
110
|
#
|
|
@@ -373,21 +356,6 @@ module OpenAI
|
|
|
373
356
|
# @return [Array<Symbol>]
|
|
374
357
|
end
|
|
375
358
|
|
|
376
|
-
class SpendControl < OpenAI::Internal::Type::BaseModel
|
|
377
|
-
# @!attribute limit
|
|
378
|
-
# Positive USD cents, or null to remove the limit.
|
|
379
|
-
#
|
|
380
|
-
# @return [Integer, nil]
|
|
381
|
-
required :limit, Integer, nil?: true
|
|
382
|
-
|
|
383
|
-
# @!method initialize(limit:)
|
|
384
|
-
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
385
|
-
# session.
|
|
386
|
-
#
|
|
387
|
-
# @param limit [Integer, nil]
|
|
388
|
-
# Positive USD cents, or null to remove the limit.
|
|
389
|
-
end
|
|
390
|
-
|
|
391
359
|
class StreamOptions < OpenAI::Internal::Type::BaseModel
|
|
392
360
|
# @!attribute include_obfuscation
|
|
393
361
|
# Whether to include obfuscation padding in events on this connection. Defaults to
|
|
@@ -46,20 +46,7 @@ module OpenAI
|
|
|
46
46
|
# @return [Symbol, OpenAI::Models::Beta::Agents::SessionUpdateParams::Review, nil]
|
|
47
47
|
optional :review, enum: -> { OpenAI::Beta::Agents::SessionUpdateParams::Review }
|
|
48
48
|
|
|
49
|
-
# @!
|
|
50
|
-
# Omit to retain the limit; null or a null limit removes it without resetting
|
|
51
|
-
# spend.
|
|
52
|
-
#
|
|
53
|
-
# @return [OpenAI::Models::Beta::Agents::SessionUpdateParams::SpendControl, nil]
|
|
54
|
-
optional(
|
|
55
|
-
:spend_control,
|
|
56
|
-
-> {
|
|
57
|
-
OpenAI::Beta::Agents::SessionUpdateParams::SpendControl
|
|
58
|
-
},
|
|
59
|
-
nil?: true
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
# @!method initialize(session_id:, agent: nil, metadata: nil, prompt_cache_options: nil, review: nil, spend_control: nil, request_options: {})
|
|
49
|
+
# @!method initialize(session_id:, agent: nil, metadata: nil, prompt_cache_options: nil, review: nil, request_options: {})
|
|
63
50
|
# @param session_id [String]
|
|
64
51
|
#
|
|
65
52
|
# @param agent [OpenAI::Models::Beta::Agents::SessionUpdateParams::Agent]
|
|
@@ -78,10 +65,6 @@ module OpenAI
|
|
|
78
65
|
# Default action review for new root turns. Existing turns and their subagents
|
|
79
66
|
# keep their review mode.
|
|
80
67
|
#
|
|
81
|
-
# @param spend_control [OpenAI::Models::Beta::Agents::SessionUpdateParams::SpendControl, nil]
|
|
82
|
-
# Omit to retain the limit; null or a null limit removes it without resetting
|
|
83
|
-
# spend.
|
|
84
|
-
#
|
|
85
68
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
86
69
|
|
|
87
70
|
class Agent < OpenAI::Internal::Type::BaseModel
|
|
@@ -246,21 +229,6 @@ module OpenAI
|
|
|
246
229
|
# @!method self.values
|
|
247
230
|
# @return [Array<Symbol>]
|
|
248
231
|
end
|
|
249
|
-
|
|
250
|
-
class SpendControl < OpenAI::Internal::Type::BaseModel
|
|
251
|
-
# @!attribute limit
|
|
252
|
-
# Positive USD cents, or null to remove the limit.
|
|
253
|
-
#
|
|
254
|
-
# @return [Integer, nil]
|
|
255
|
-
required :limit, Integer, nil?: true
|
|
256
|
-
|
|
257
|
-
# @!method initialize(limit:)
|
|
258
|
-
# Omit to retain the limit; null or a null limit removes it without resetting
|
|
259
|
-
# spend.
|
|
260
|
-
#
|
|
261
|
-
# @param limit [Integer, nil]
|
|
262
|
-
# Positive USD cents, or null to remove the limit.
|
|
263
|
-
end
|
|
264
232
|
end
|
|
265
233
|
end
|
|
266
234
|
end
|
|
@@ -37,9 +37,6 @@ module OpenAI
|
|
|
37
37
|
# The model reached its output token limit before finishing the response.
|
|
38
38
|
MAX_OUTPUT_TOKENS = :max_output_tokens
|
|
39
39
|
|
|
40
|
-
# The session has reached its usage budget.
|
|
41
|
-
SESSION_BUDGET_EXCEEDED = :session_budget_exceeded
|
|
42
|
-
|
|
43
40
|
# The organization has reached a usage, plan, or billing limit.
|
|
44
41
|
USAGE_LIMIT_EXCEEDED = :usage_limit_exceeded
|
|
45
42
|
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
class CsamModeration < OpenAI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute categories
|
|
7
|
+
# Whether the image was flagged in each category.
|
|
8
|
+
#
|
|
9
|
+
# @return [OpenAI::Models::CsamModeration::Categories]
|
|
10
|
+
required :categories, -> { OpenAI::CsamModeration::Categories }
|
|
11
|
+
|
|
12
|
+
# @!attribute category_applied_input_types
|
|
13
|
+
# The input types evaluated for each category.
|
|
14
|
+
#
|
|
15
|
+
# @return [OpenAI::Models::CsamModeration::CategoryAppliedInputTypes]
|
|
16
|
+
required :category_applied_input_types, -> { OpenAI::CsamModeration::CategoryAppliedInputTypes }
|
|
17
|
+
|
|
18
|
+
# @!attribute category_scores
|
|
19
|
+
# The classifier score for each category.
|
|
20
|
+
#
|
|
21
|
+
# @return [OpenAI::Models::CsamModeration::CategoryScores]
|
|
22
|
+
required :category_scores, -> { OpenAI::CsamModeration::CategoryScores }
|
|
23
|
+
|
|
24
|
+
# @!attribute flagged
|
|
25
|
+
# Whether either CSAM category was flagged.
|
|
26
|
+
#
|
|
27
|
+
# @return [Boolean]
|
|
28
|
+
required :flagged, OpenAI::Internal::Type::Boolean
|
|
29
|
+
|
|
30
|
+
# @!method initialize(categories:, category_applied_input_types:, category_scores:, flagged:)
|
|
31
|
+
# @param categories [OpenAI::Models::CsamModeration::Categories]
|
|
32
|
+
# Whether the image was flagged in each category.
|
|
33
|
+
#
|
|
34
|
+
# @param category_applied_input_types [OpenAI::Models::CsamModeration::CategoryAppliedInputTypes]
|
|
35
|
+
# The input types evaluated for each category.
|
|
36
|
+
#
|
|
37
|
+
# @param category_scores [OpenAI::Models::CsamModeration::CategoryScores]
|
|
38
|
+
# The classifier score for each category.
|
|
39
|
+
#
|
|
40
|
+
# @param flagged [Boolean]
|
|
41
|
+
# Whether either CSAM category was flagged.
|
|
42
|
+
|
|
43
|
+
# @see OpenAI::Models::CsamModeration#categories
|
|
44
|
+
class Categories < OpenAI::Internal::Type::BaseModel
|
|
45
|
+
# @!attribute likely_csam
|
|
46
|
+
#
|
|
47
|
+
# @return [Boolean]
|
|
48
|
+
required :likely_csam, OpenAI::Internal::Type::Boolean, api_name: :"likely-csam"
|
|
49
|
+
|
|
50
|
+
# @!attribute likely_csam_gen_ai
|
|
51
|
+
#
|
|
52
|
+
# @return [Boolean]
|
|
53
|
+
required :likely_csam_gen_ai, OpenAI::Internal::Type::Boolean, api_name: :"likely-csam/gen-ai"
|
|
54
|
+
|
|
55
|
+
# @!method initialize(likely_csam:, likely_csam_gen_ai:)
|
|
56
|
+
# Whether the image was flagged in each category.
|
|
57
|
+
#
|
|
58
|
+
# @param likely_csam [Boolean]
|
|
59
|
+
# @param likely_csam_gen_ai [Boolean]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# @see OpenAI::Models::CsamModeration#category_applied_input_types
|
|
63
|
+
class CategoryAppliedInputTypes < OpenAI::Internal::Type::BaseModel
|
|
64
|
+
# @!attribute likely_csam
|
|
65
|
+
#
|
|
66
|
+
# @return [Array<Symbol, OpenAI::Models::CsamModeration::CategoryAppliedInputTypes::LikelyCsam>]
|
|
67
|
+
required(
|
|
68
|
+
:likely_csam,
|
|
69
|
+
-> {
|
|
70
|
+
OpenAI::Internal::Type::ArrayOf[enum: OpenAI::CsamModeration::CategoryAppliedInputTypes::LikelyCsam]
|
|
71
|
+
},
|
|
72
|
+
api_name: :"likely-csam"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# @!attribute likely_csam_gen_ai
|
|
76
|
+
#
|
|
77
|
+
# @return [Array<Symbol, OpenAI::Models::CsamModeration::CategoryAppliedInputTypes::LikelyCsamGenAi>]
|
|
78
|
+
required(
|
|
79
|
+
:likely_csam_gen_ai,
|
|
80
|
+
-> {
|
|
81
|
+
OpenAI::Internal::Type::ArrayOf[enum: OpenAI::CsamModeration::CategoryAppliedInputTypes::LikelyCsamGenAi]
|
|
82
|
+
},
|
|
83
|
+
api_name: :"likely-csam/gen-ai"
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# @!method initialize(likely_csam:, likely_csam_gen_ai:)
|
|
87
|
+
# The input types evaluated for each category.
|
|
88
|
+
#
|
|
89
|
+
# @param likely_csam [Array<Symbol, OpenAI::Models::CsamModeration::CategoryAppliedInputTypes::LikelyCsam>]
|
|
90
|
+
# @param likely_csam_gen_ai [Array<Symbol, OpenAI::Models::CsamModeration::CategoryAppliedInputTypes::LikelyCsamGenAi>]
|
|
91
|
+
|
|
92
|
+
module LikelyCsam
|
|
93
|
+
extend OpenAI::Internal::Type::Enum
|
|
94
|
+
|
|
95
|
+
IMAGE = :image
|
|
96
|
+
|
|
97
|
+
# @!method self.values
|
|
98
|
+
# @return [Array<Symbol>]
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
module LikelyCsamGenAi
|
|
102
|
+
extend OpenAI::Internal::Type::Enum
|
|
103
|
+
|
|
104
|
+
IMAGE = :image
|
|
105
|
+
|
|
106
|
+
# @!method self.values
|
|
107
|
+
# @return [Array<Symbol>]
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @see OpenAI::Models::CsamModeration#category_scores
|
|
112
|
+
class CategoryScores < OpenAI::Internal::Type::BaseModel
|
|
113
|
+
# @!attribute likely_csam
|
|
114
|
+
#
|
|
115
|
+
# @return [Float]
|
|
116
|
+
required :likely_csam, Float, api_name: :"likely-csam"
|
|
117
|
+
|
|
118
|
+
# @!attribute likely_csam_gen_ai
|
|
119
|
+
#
|
|
120
|
+
# @return [Float]
|
|
121
|
+
required :likely_csam_gen_ai, Float, api_name: :"likely-csam/gen-ai"
|
|
122
|
+
|
|
123
|
+
# @!method initialize(likely_csam:, likely_csam_gen_ai:)
|
|
124
|
+
# The classifier score for each category.
|
|
125
|
+
#
|
|
126
|
+
# @param likely_csam [Float]
|
|
127
|
+
# @param likely_csam_gen_ai [Float]
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
class CsamModerationResponse < OpenAI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute id
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :id, String
|
|
10
|
+
|
|
11
|
+
# @!attribute model
|
|
12
|
+
#
|
|
13
|
+
# @return [Symbol, :"omni-moderation-csam-latest"]
|
|
14
|
+
required :model, const: :"omni-moderation-csam-latest"
|
|
15
|
+
|
|
16
|
+
# @!attribute results
|
|
17
|
+
#
|
|
18
|
+
# @return [Array<OpenAI::Models::CsamModeration>]
|
|
19
|
+
required :results, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::CsamModeration] }
|
|
20
|
+
|
|
21
|
+
# @!method initialize(id:, results:, model: :"omni-moderation-csam-latest")
|
|
22
|
+
# @param id [String]
|
|
23
|
+
# @param results [Array<OpenAI::Models::CsamModeration>]
|
|
24
|
+
# @param model [Symbol, :"omni-moderation-csam-latest"]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class McpRequireApprovalFilter < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute always
|
|
8
|
+
# A filter that forces approval for matching tools.
|
|
9
|
+
#
|
|
10
|
+
# @return [OpenAI::Models::Live::McpToolFilter, nil]
|
|
11
|
+
optional :always, -> { OpenAI::Live::McpToolFilter }, nil?: true
|
|
12
|
+
|
|
13
|
+
# @!attribute never
|
|
14
|
+
# A filter that skips approval for matching tools.
|
|
15
|
+
#
|
|
16
|
+
# @return [OpenAI::Models::Live::McpToolFilter, nil]
|
|
17
|
+
optional :never, -> { OpenAI::Live::McpToolFilter }, nil?: true
|
|
18
|
+
|
|
19
|
+
# @!method initialize(always: nil, never: nil)
|
|
20
|
+
# @param always [OpenAI::Models::Live::McpToolFilter, nil]
|
|
21
|
+
# A filter that forces approval for matching tools.
|
|
22
|
+
#
|
|
23
|
+
# @param never [OpenAI::Models::Live::McpToolFilter, nil]
|
|
24
|
+
# A filter that skips approval for matching tools.
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|