Class: Contai::ContaiConfig
- Inherits:
-
Object
- Object
- Contai::ContaiConfig
- Defined in:
- lib/contai/generatable.rb
Instance Attribute Summary collapse
-
#output_field ⇒ Object
Returns the value of attribute output_field.
-
#prompt_fields ⇒ Object
Returns the value of attribute prompt_fields.
-
#provider_options ⇒ Object
Returns the value of attribute provider_options.
-
#provider_type ⇒ Object
Returns the value of attribute provider_type.
-
#template(tmpl) ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize ⇒ ContaiConfig
constructor
A new instance of ContaiConfig.
- #output_to(field) ⇒ Object
- #prompt_from(*fields) ⇒ Object
- #provider(type, options = {}) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ ContaiConfig
Returns a new instance of ContaiConfig.
67 68 69 70 71 72 73 |
# File 'lib/contai/generatable.rb', line 67 def initialize @prompt_fields = [:prompt] @output_field = :body @provider_type = :http @provider_options = {} @template = nil end |
Instance Attribute Details
#output_field ⇒ Object
Returns the value of attribute output_field.
65 66 67 |
# File 'lib/contai/generatable.rb', line 65 def output_field @output_field end |
#prompt_fields ⇒ Object
Returns the value of attribute prompt_fields.
65 66 67 |
# File 'lib/contai/generatable.rb', line 65 def prompt_fields @prompt_fields end |
#provider_options ⇒ Object
Returns the value of attribute provider_options.
65 66 67 |
# File 'lib/contai/generatable.rb', line 65 def @provider_options end |
#provider_type ⇒ Object
Returns the value of attribute provider_type.
65 66 67 |
# File 'lib/contai/generatable.rb', line 65 def provider_type @provider_type end |
#template(tmpl) ⇒ Object
Returns the value of attribute template.
65 66 67 |
# File 'lib/contai/generatable.rb', line 65 def template @template end |
Instance Method Details
#output_to(field) ⇒ Object
79 80 81 |
# File 'lib/contai/generatable.rb', line 79 def output_to(field) @output_field = field end |
#prompt_from(*fields) ⇒ Object
75 76 77 |
# File 'lib/contai/generatable.rb', line 75 def prompt_from(*fields) @prompt_fields = fields end |
#provider(type, options = {}) ⇒ Object
83 84 85 86 |
# File 'lib/contai/generatable.rb', line 83 def provider(type, = {}) @provider_type = type @provider_options = end |
#to_h ⇒ Object
92 93 94 95 96 97 98 99 100 |
# File 'lib/contai/generatable.rb', line 92 def to_h { prompt_fields: @prompt_fields, output_field: @output_field, provider: @provider_type, provider_options: @provider_options, template: @template } end |