Class: OpenAI::Responses::SessionLimits
- Inherits:
-
Object
- Object
- OpenAI::Responses::SessionLimits
- Defined in:
- lib/openai/helpers/responses_websocket/session.rb
Overview
Explicit application budgets for an opt-in session, not service limits. Bytes count serialized event data, not Ruby object or transport overhead. max_lanes counts all registered IDs, including detached IDs, until reconnect.
Instance Attribute Summary collapse
-
#max_bytes ⇒ Object
readonly
Returns the value of attribute max_bytes.
-
#max_bytes_per_lane ⇒ Object
readonly
Returns the value of attribute max_bytes_per_lane.
-
#max_events ⇒ Object
readonly
Returns the value of attribute max_events.
-
#max_events_per_lane ⇒ Object
readonly
Returns the value of attribute max_events_per_lane.
-
#max_lanes ⇒ Object
readonly
Returns the value of attribute max_lanes.
-
#max_response_bytes ⇒ Object
readonly
Returns the value of attribute max_response_bytes.
Instance Method Summary collapse
-
#initialize(max_lanes:, max_events_per_lane:, max_events:, max_bytes_per_lane:, max_bytes:, max_response_bytes:) ⇒ SessionLimits
constructor
A new instance of SessionLimits.
Constructor Details
#initialize(max_lanes:, max_events_per_lane:, max_events:, max_bytes_per_lane:, max_bytes:, max_response_bytes:) ⇒ SessionLimits
Returns a new instance of SessionLimits.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/openai/helpers/responses_websocket/session.rb', line 38 def initialize( max_lanes:, max_events_per_lane:, max_events:, max_bytes_per_lane:, max_bytes:, max_response_bytes: ) values = [max_lanes, max_events_per_lane, max_events, max_bytes_per_lane, max_bytes, max_response_bytes] unless values.all? { |value| value.is_a?(Integer) && value.positive? } raise ArgumentError, "Responses session limits must be positive integers." end @max_lanes, @max_events_per_lane, @max_events, @max_bytes_per_lane, @max_bytes, @max_response_bytes = values freeze end |
Instance Attribute Details
#max_bytes ⇒ Object (readonly)
Returns the value of attribute max_bytes.
29 30 31 |
# File 'lib/openai/helpers/responses_websocket/session.rb', line 29 def max_bytes @max_bytes end |
#max_bytes_per_lane ⇒ Object (readonly)
Returns the value of attribute max_bytes_per_lane.
29 30 31 |
# File 'lib/openai/helpers/responses_websocket/session.rb', line 29 def max_bytes_per_lane @max_bytes_per_lane end |
#max_events ⇒ Object (readonly)
Returns the value of attribute max_events.
29 30 31 |
# File 'lib/openai/helpers/responses_websocket/session.rb', line 29 def max_events @max_events end |
#max_events_per_lane ⇒ Object (readonly)
Returns the value of attribute max_events_per_lane.
29 30 31 |
# File 'lib/openai/helpers/responses_websocket/session.rb', line 29 def max_events_per_lane @max_events_per_lane end |
#max_lanes ⇒ Object (readonly)
Returns the value of attribute max_lanes.
29 30 31 |
# File 'lib/openai/helpers/responses_websocket/session.rb', line 29 def max_lanes @max_lanes end |
#max_response_bytes ⇒ Object (readonly)
Returns the value of attribute max_response_bytes.
29 30 31 |
# File 'lib/openai/helpers/responses_websocket/session.rb', line 29 def max_response_bytes @max_response_bytes end |