Class: Vapi::TestSuiteRunScorerAi
- Inherits:
-
Object
- Object
- Vapi::TestSuiteRunScorerAi
- Defined in:
- lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#reasoning ⇒ String
readonly
This is the reasoning provided by the AI scorer.
-
#result ⇒ Vapi::TestSuiteRunScorerAiResult
readonly
This is the result of the test suite.
-
#rubric ⇒ String
readonly
This is the rubric used by the AI scorer.
-
#type ⇒ String
readonly
This is the type of the scorer, which must be AI.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TestSuiteRunScorerAi
Deserialize a JSON object to an instance of TestSuiteRunScorerAi.
-
.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:, result:, reasoning:, rubric:, additional_properties: nil) ⇒ Vapi::TestSuiteRunScorerAi constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TestSuiteRunScorerAi to a JSON object.
Constructor Details
#initialize(type:, result:, reasoning:, rubric:, additional_properties: nil) ⇒ Vapi::TestSuiteRunScorerAi
31 32 33 34 35 36 37 38 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 31 def initialize(type:, result:, reasoning:, rubric:, additional_properties: nil) @type = type @result = result @reasoning = reasoning @rubric = rubric @additional_properties = additional_properties @_field_set = { "type": type, "result": result, "reasoning": reasoning, "rubric": rubric } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 18 def additional_properties @additional_properties end |
#reasoning ⇒ String (readonly)
Returns This is the reasoning provided by the AI scorer.
14 15 16 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 14 def reasoning @reasoning end |
#result ⇒ Vapi::TestSuiteRunScorerAiResult (readonly)
Returns This is the result of the test suite.
12 13 14 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 12 def result @result end |
#rubric ⇒ String (readonly)
Returns This is the rubric used by the AI scorer.
16 17 18 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 16 def rubric @rubric end |
#type ⇒ String (readonly)
Returns This is the type of the scorer, which must be AI.
10 11 12 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 10 def type @type end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TestSuiteRunScorerAi
Deserialize a JSON object to an instance of TestSuiteRunScorerAi
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) type = parsed_json["type"] result = parsed_json["result"] reasoning = parsed_json["reasoning"] rubric = parsed_json["rubric"] new( type: type, result: result, reasoning: reasoning, rubric: rubric, 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.
73 74 75 76 77 78 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 73 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.result.is_a?(Vapi::TestSuiteRunScorerAiResult) != false || raise("Passed value for field obj.result is not the expected type, validation failed.") obj.reasoning.is_a?(String) != false || raise("Passed value for field obj.reasoning is not the expected type, validation failed.") obj.rubric.is_a?(String) != false || raise("Passed value for field obj.rubric is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TestSuiteRunScorerAi to a JSON object
63 64 65 |
# File 'lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb', line 63 def to_json(*_args) @_field_set&.to_json end |