Class: OpenAICompatibleErrors::Redaction::Limits
- Inherits:
-
Struct
- Object
- Struct
- OpenAICompatibleErrors::Redaction::Limits
- Defined in:
- lib/openai_compatible_errors/redaction.rb
Instance Attribute Summary collapse
-
#max_chars ⇒ Object
Returns the value of attribute max_chars.
-
#max_depth ⇒ Object
Returns the value of attribute max_depth.
-
#max_items ⇒ Object
Returns the value of attribute max_items.
-
#max_keys ⇒ Object
Returns the value of attribute max_keys.
-
#max_nodes ⇒ Object
Returns the value of attribute max_nodes.
-
#max_replacements ⇒ Object
Returns the value of attribute max_replacements.
Instance Method Summary collapse
-
#initialize(max_depth: 4, max_nodes: 250, max_keys: 32, max_items: 32, max_chars: 8_192, max_replacements: 64) ⇒ Limits
constructor
A new instance of Limits.
Constructor Details
#initialize(max_depth: 4, max_nodes: 250, max_keys: 32, max_items: 32, max_chars: 8_192, max_replacements: 64) ⇒ Limits
Returns a new instance of Limits.
11 12 13 14 15 16 17 18 19 |
# File 'lib/openai_compatible_errors/redaction.rb', line 11 def initialize(max_depth: 4, max_nodes: 250, max_keys: 32, max_items: 32, max_chars: 8_192, max_replacements: 64) super raise ArgumentError, "limits must be positive" unless [max_depth, max_nodes, max_keys, max_items, max_chars, max_replacements].all? do |value| value.is_a?(Integer) && value.positive? end freeze end |
Instance Attribute Details
#max_chars ⇒ Object
Returns the value of attribute max_chars
9 10 11 |
# File 'lib/openai_compatible_errors/redaction.rb', line 9 def max_chars @max_chars end |
#max_depth ⇒ Object
Returns the value of attribute max_depth
9 10 11 |
# File 'lib/openai_compatible_errors/redaction.rb', line 9 def max_depth @max_depth end |
#max_items ⇒ Object
Returns the value of attribute max_items
9 10 11 |
# File 'lib/openai_compatible_errors/redaction.rb', line 9 def max_items @max_items end |
#max_keys ⇒ Object
Returns the value of attribute max_keys
9 10 11 |
# File 'lib/openai_compatible_errors/redaction.rb', line 9 def max_keys @max_keys end |
#max_nodes ⇒ Object
Returns the value of attribute max_nodes
9 10 11 |
# File 'lib/openai_compatible_errors/redaction.rb', line 9 def max_nodes @max_nodes end |
#max_replacements ⇒ Object
Returns the value of attribute max_replacements
9 10 11 |
# File 'lib/openai_compatible_errors/redaction.rb', line 9 def max_replacements @max_replacements end |