Class: Vapi::TranscriptionEndpointingPlan
- Inherits:
-
Object
- Object
- Vapi::TranscriptionEndpointingPlan
- Defined in:
- lib/vapi_server_sdk/types/transcription_endpointing_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#on_no_punctuation_seconds ⇒ Float
readonly
The minimum number of seconds to wait after transcription ending without punctuation before sending a request to the model.
-
#on_number_seconds ⇒ Float
readonly
The minimum number of seconds to wait after transcription ending with a number before sending a request to the model.
-
#on_punctuation_seconds ⇒ Float
readonly
The minimum number of seconds to wait after transcription ending with punctuation before sending a request to the model.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TranscriptionEndpointingPlan
Deserialize a JSON object to an instance of TranscriptionEndpointingPlan.
-
.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(on_punctuation_seconds: OMIT, on_no_punctuation_seconds: OMIT, on_number_seconds: OMIT, additional_properties: nil) ⇒ Vapi::TranscriptionEndpointingPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TranscriptionEndpointingPlan to a JSON object.
Constructor Details
#initialize(on_punctuation_seconds: OMIT, on_no_punctuation_seconds: OMIT, on_number_seconds: OMIT, additional_properties: nil) ⇒ Vapi::TranscriptionEndpointingPlan
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/vapi_server_sdk/types/transcription_endpointing_plan.rb', line 57 def initialize(on_punctuation_seconds: OMIT, on_no_punctuation_seconds: OMIT, on_number_seconds: OMIT, additional_properties: nil) @on_punctuation_seconds = on_punctuation_seconds if on_punctuation_seconds != OMIT @on_no_punctuation_seconds = on_no_punctuation_seconds if on_no_punctuation_seconds != OMIT @on_number_seconds = on_number_seconds if on_number_seconds != OMIT @additional_properties = additional_properties @_field_set = { "onPunctuationSeconds": on_punctuation_seconds, "onNoPunctuationSeconds": on_no_punctuation_seconds, "onNumberSeconds": on_number_seconds }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
30 31 32 |
# File 'lib/vapi_server_sdk/types/transcription_endpointing_plan.rb', line 30 def additional_properties @additional_properties end |
#on_no_punctuation_seconds ⇒ Float (readonly)
Returns The minimum number of seconds to wait after transcription ending without punctuation before sending a request to the model. Defaults to 1.5. This setting exists to catch the cases where the transcriber was not confident enough to punctuate the transcription, but the customer is done and has been silent for a long time. @default 1.5.
20 21 22 |
# File 'lib/vapi_server_sdk/types/transcription_endpointing_plan.rb', line 20 def on_no_punctuation_seconds @on_no_punctuation_seconds end |
#on_number_seconds ⇒ Float (readonly)
Returns The minimum number of seconds to wait after transcription ending with a number before sending a request to the model. Defaults to 0.4. This setting exists because the transcriber will sometimes punctuate the transcription ending with a number, even though the customer hasn’t uttered the full number. This happens commonly for long numbers when the customer reads the number in chunks. @default 0.5.
28 29 30 |
# File 'lib/vapi_server_sdk/types/transcription_endpointing_plan.rb', line 28 def on_number_seconds @on_number_seconds end |
#on_punctuation_seconds ⇒ Float (readonly)
Returns The minimum number of seconds to wait after transcription ending with punctuation before sending a request to the model. Defaults to 0.1. This setting exists because the transcriber punctuates the transcription when it’s more confident that customer has completed a thought. @default 0.1.
13 14 15 |
# File 'lib/vapi_server_sdk/types/transcription_endpointing_plan.rb', line 13 def on_punctuation_seconds @on_punctuation_seconds end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TranscriptionEndpointingPlan
Deserialize a JSON object to an instance of TranscriptionEndpointingPlan
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/vapi_server_sdk/types/transcription_endpointing_plan.rb', line 76 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) on_punctuation_seconds = parsed_json["onPunctuationSeconds"] on_no_punctuation_seconds = parsed_json["onNoPunctuationSeconds"] on_number_seconds = parsed_json["onNumberSeconds"] new( on_punctuation_seconds: on_punctuation_seconds, on_no_punctuation_seconds: on_no_punctuation_seconds, on_number_seconds: on_number_seconds, 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.
103 104 105 106 107 |
# File 'lib/vapi_server_sdk/types/transcription_endpointing_plan.rb', line 103 def self.validate_raw(obj:) obj.on_punctuation_seconds&.is_a?(Float) != false || raise("Passed value for field obj.on_punctuation_seconds is not the expected type, validation failed.") obj.on_no_punctuation_seconds&.is_a?(Float) != false || raise("Passed value for field obj.on_no_punctuation_seconds is not the expected type, validation failed.") obj.on_number_seconds&.is_a?(Float) != false || raise("Passed value for field obj.on_number_seconds is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TranscriptionEndpointingPlan to a JSON object
93 94 95 |
# File 'lib/vapi_server_sdk/types/transcription_endpointing_plan.rb', line 93 def to_json(*_args) @_field_set&.to_json end |