Class: LangExtract::ModelConfig
- Inherits:
-
Object
- Object
- LangExtract::ModelConfig
- Defined in:
- lib/langextract/factory.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize(adapter: "ruby_llm", provider: nil, model: nil, **options) ⇒ ModelConfig
constructor
A new instance of ModelConfig.
- #to_h ⇒ Object
Constructor Details
#initialize(adapter: "ruby_llm", provider: nil, model: nil, **options) ⇒ ModelConfig
Returns a new instance of ModelConfig.
12 13 14 15 16 17 18 19 20 |
# File 'lib/langextract/factory.rb', line 12 def initialize(adapter: "ruby_llm", provider: nil, model: nil, **) @adapter = adapter.to_s @provider = provider&.to_s @model = model || LangExtract.config.default_model @options = .freeze validate! freeze end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
10 11 12 |
# File 'lib/langextract/factory.rb', line 10 def adapter @adapter end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
10 11 12 |
# File 'lib/langextract/factory.rb', line 10 def model @model end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/langextract/factory.rb', line 10 def @options end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
10 11 12 |
# File 'lib/langextract/factory.rb', line 10 def provider @provider end |
Instance Method Details
#to_h ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/langextract/factory.rb', line 22 def to_h { "adapter" => adapter, "provider" => provider, "model" => model, "options" => } end |