Class: Vapi::TesterPlan
- Inherits:
-
Object
- Object
- Vapi::TesterPlan
- Defined in:
- lib/vapi_server_sdk/types/tester_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#assistant ⇒ Vapi::CreateAssistantDto
readonly
Pass a transient assistant to use for the test assistant.
-
#assistant_id ⇒ String
readonly
Pass an assistant id that can be access Make sure to write a detailed system prompt for the test assistant, and use the {test{test.script} variable to access the test script.
-
#assistant_overrides ⇒ Vapi::AssistantOverrides
readonly
Add any assistant overrides to the test assistant.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TesterPlan
Deserialize a JSON object to an instance of TesterPlan.
-
.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(assistant: OMIT, assistant_id: OMIT, assistant_overrides: OMIT, additional_properties: nil) ⇒ Vapi::TesterPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TesterPlan to a JSON object.
Constructor Details
#initialize(assistant: OMIT, assistant_id: OMIT, assistant_overrides: OMIT, additional_properties: nil) ⇒ Vapi::TesterPlan
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vapi_server_sdk/types/tester_plan.rb', line 43 def initialize(assistant: OMIT, assistant_id: OMIT, assistant_overrides: OMIT, additional_properties: nil) @assistant = assistant if assistant != OMIT @assistant_id = assistant_id if assistant_id != OMIT @assistant_overrides = assistant_overrides if assistant_overrides != OMIT @additional_properties = additional_properties @_field_set = { "assistant": assistant, "assistantId": assistant_id, "assistantOverrides": assistant_overrides }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/vapi_server_sdk/types/tester_plan.rb', line 24 def additional_properties @additional_properties end |
#assistant ⇒ Vapi::CreateAssistantDto (readonly)
Returns Pass a transient assistant to use for the test assistant. Make sure to write a detailed system prompt for a test assistant, and use the Vapi::TesterPlan.{test{test.script} variable to access the test script.
13 14 15 |
# File 'lib/vapi_server_sdk/types/tester_plan.rb', line 13 def assistant @assistant end |
#assistant_id ⇒ String (readonly)
Returns Pass an assistant id that can be access Make sure to write a detailed system prompt for the test assistant, and use the Vapi::TesterPlan.{test{test.script} variable to access the test script.
17 18 19 |
# File 'lib/vapi_server_sdk/types/tester_plan.rb', line 17 def assistant_id @assistant_id end |
#assistant_overrides ⇒ Vapi::AssistantOverrides (readonly)
Returns Add any assistant overrides to the test assistant. One use case is if you want to pass custom variables into the test using variableValues, that you can then access in the script and rubric using {varName}.
22 23 24 |
# File 'lib/vapi_server_sdk/types/tester_plan.rb', line 22 def assistant_overrides @assistant_overrides end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TesterPlan
Deserialize a JSON object to an instance of TesterPlan
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/vapi_server_sdk/types/tester_plan.rb', line 61 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["assistant"].nil? assistant = nil else assistant = parsed_json["assistant"].to_json assistant = Vapi::CreateAssistantDto.from_json(json_object: assistant) end assistant_id = parsed_json["assistantId"] if parsed_json["assistantOverrides"].nil? assistant_overrides = nil else assistant_overrides = parsed_json["assistantOverrides"].to_json assistant_overrides = Vapi::AssistantOverrides.from_json(json_object: assistant_overrides) end new( assistant: assistant, assistant_id: assistant_id, assistant_overrides: assistant_overrides, 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.
98 99 100 101 102 |
# File 'lib/vapi_server_sdk/types/tester_plan.rb', line 98 def self.validate_raw(obj:) obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant) obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.") obj.assistant_overrides.nil? || Vapi::AssistantOverrides.validate_raw(obj: obj.assistant_overrides) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TesterPlan to a JSON object
88 89 90 |
# File 'lib/vapi_server_sdk/types/tester_plan.rb', line 88 def to_json(*_args) @_field_set&.to_json end |