Class: PromptSpec
- Inherits:
-
Object
- Object
- PromptSpec
- Defined in:
- lib/promptspec.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#validate_required_params ⇒ Object
readonly
Returns the value of attribute validate_required_params.
-
#yaml_content ⇒ Object
readonly
Returns the value of attribute yaml_content.
Instance Method Summary collapse
- #call(**parameters) ⇒ Object
-
#initialize(file_path, validate_required_params: true) ⇒ PromptSpec
constructor
A new instance of PromptSpec.
Constructor Details
#initialize(file_path, validate_required_params: true) ⇒ PromptSpec
Returns a new instance of PromptSpec.
11 12 13 14 15 |
# File 'lib/promptspec.rb', line 11 def initialize(file_path, validate_required_params: true) @file_path = file_path @validate_required_params = validate_required_params load_parse_file! end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
9 10 11 |
# File 'lib/promptspec.rb', line 9 def file_path @file_path end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
9 10 11 |
# File 'lib/promptspec.rb', line 9 def parameters @parameters end |
#validate_required_params ⇒ Object (readonly)
Returns the value of attribute validate_required_params.
9 10 11 |
# File 'lib/promptspec.rb', line 9 def validate_required_params @validate_required_params end |
#yaml_content ⇒ Object (readonly)
Returns the value of attribute yaml_content.
9 10 11 |
# File 'lib/promptspec.rb', line 9 def yaml_content @yaml_content end |
Instance Method Details
#call(**parameters) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/promptspec.rb', line 17 def call(**parameters) @parameters = parameters validate_required_inputs! if @validate_required_params construct_endpoint_request end |