Class: Vapi::AnthropicThinkingConfig
- Inherits:
-
Object
- Object
- Vapi::AnthropicThinkingConfig
- Defined in:
- lib/vapi_server_sdk/types/anthropic_thinking_config.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#budget_tokens ⇒ Float
readonly
The maximum number of tokens to allocate for thinking.
- #type ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::AnthropicThinkingConfig
Deserialize a JSON object to an instance of AnthropicThinkingConfig.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(type:, budget_tokens:, additional_properties: nil) ⇒ Vapi::AnthropicThinkingConfig constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AnthropicThinkingConfig to a JSON object.
Constructor Details
#initialize(type:, budget_tokens:, additional_properties: nil) ⇒ Vapi::AnthropicThinkingConfig
26 27 28 29 30 31 |
# File 'lib/vapi_server_sdk/types/anthropic_thinking_config.rb', line 26 def initialize(type:, budget_tokens:, additional_properties: nil) @type = type @budget_tokens = budget_tokens @additional_properties = additional_properties @_field_set = { "type": type, "budgetTokens": budget_tokens } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/vapi_server_sdk/types/anthropic_thinking_config.rb', line 14 def additional_properties @additional_properties end |
#budget_tokens ⇒ Float (readonly)
Returns The maximum number of tokens to allocate for thinking. Must be between 1024 and 100000 tokens.
12 13 14 |
# File 'lib/vapi_server_sdk/types/anthropic_thinking_config.rb', line 12 def budget_tokens @budget_tokens end |
#type ⇒ String (readonly)
9 10 11 |
# File 'lib/vapi_server_sdk/types/anthropic_thinking_config.rb', line 9 def type @type end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::AnthropicThinkingConfig
Deserialize a JSON object to an instance of AnthropicThinkingConfig
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/vapi_server_sdk/types/anthropic_thinking_config.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) type = parsed_json["type"] budget_tokens = parsed_json["budgetTokens"] new( type: type, budget_tokens: budget_tokens, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
62 63 64 65 |
# File 'lib/vapi_server_sdk/types/anthropic_thinking_config.rb', line 62 def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.budget_tokens.is_a?(Float) != false || raise("Passed value for field obj.budget_tokens is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AnthropicThinkingConfig to a JSON object
52 53 54 |
# File 'lib/vapi_server_sdk/types/anthropic_thinking_config.rb', line 52 def to_json(*_args) @_field_set&.to_json end |