Class: Vapi::Analysis
- Inherits:
-
Object
- Object
- Vapi::Analysis
- Defined in:
- lib/vapi_server_sdk/types/analysis.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#structured_data ⇒ Hash{String => Object}
readonly
This is the structured data extracted from the call.
-
#structured_data_multi ⇒ Array<Hash{String => Object}>
readonly
This is the structured data catalog of the call.
-
#success_evaluation ⇒ String
readonly
This is the evaluation of the call.
-
#summary ⇒ String
readonly
This is the summary of the call.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::Analysis
Deserialize a JSON object to an instance of Analysis.
-
.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(summary: OMIT, structured_data: OMIT, structured_data_multi: OMIT, success_evaluation: OMIT, additional_properties: nil) ⇒ Vapi::Analysis constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Analysis to a JSON object.
Constructor Details
#initialize(summary: OMIT, structured_data: OMIT, structured_data_multi: OMIT, success_evaluation: OMIT, additional_properties: nil) ⇒ Vapi::Analysis
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 42 def initialize(summary: OMIT, structured_data: OMIT, structured_data_multi: OMIT, success_evaluation: OMIT, additional_properties: nil) @summary = summary if summary != OMIT @structured_data = structured_data if structured_data != OMIT @structured_data_multi = structured_data_multi if structured_data_multi != OMIT @success_evaluation = success_evaluation if success_evaluation != OMIT @additional_properties = additional_properties @_field_set = { "summary": summary, "structuredData": structured_data, "structuredDataMulti": structured_data_multi, "successEvaluation": success_evaluation }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
23 24 25 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 23 def additional_properties @additional_properties end |
#structured_data ⇒ Hash{String => Object} (readonly)
Returns This is the structured data extracted from the call. Customize by setting ‘assistant.analysisPlan.structuredDataPrompt` and/or `assistant.analysisPlan.structuredDataSchema`.
14 15 16 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 14 def structured_data @structured_data end |
#structured_data_multi ⇒ Array<Hash{String => Object}> (readonly)
Returns This is the structured data catalog of the call. Customize by setting ‘assistant.analysisPlan.structuredDataMultiPlan`.
17 18 19 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 17 def structured_data_multi @structured_data_multi end |
#success_evaluation ⇒ String (readonly)
Returns This is the evaluation of the call. Customize by setting ‘assistant.analysisPlan.successEvaluationPrompt` and/or `assistant.analysisPlan.successEvaluationRubric`.
21 22 23 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 21 def success_evaluation @success_evaluation end |
#summary ⇒ String (readonly)
Returns This is the summary of the call. Customize by setting ‘assistant.analysisPlan.summaryPrompt`.
10 11 12 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 10 def summary @summary end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::Analysis
Deserialize a JSON object to an instance of Analysis
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 63 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) summary = parsed_json["summary"] structured_data = parsed_json["structuredData"] structured_data_multi = parsed_json["structuredDataMulti"] success_evaluation = parsed_json["successEvaluation"] new( summary: summary, structured_data: structured_data, structured_data_multi: structured_data_multi, success_evaluation: success_evaluation, 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.
92 93 94 95 96 97 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 92 def self.validate_raw(obj:) obj.summary&.is_a?(String) != false || raise("Passed value for field obj.summary is not the expected type, validation failed.") obj.structured_data&.is_a?(Hash) != false || raise("Passed value for field obj.structured_data is not the expected type, validation failed.") obj.structured_data_multi&.is_a?(Array) != false || raise("Passed value for field obj.structured_data_multi is not the expected type, validation failed.") obj.success_evaluation&.is_a?(String) != false || raise("Passed value for field obj.success_evaluation is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Analysis to a JSON object
82 83 84 |
# File 'lib/vapi_server_sdk/types/analysis.rb', line 82 def to_json(*_args) @_field_set&.to_json end |