Class: RLM::Predict
- Inherits:
-
Object
- Object
- RLM::Predict
- Defined in:
- lib/rlm/predict.rb
Instance Attribute Summary collapse
-
#limits ⇒ Object
readonly
Returns the value of attribute limits.
-
#lm ⇒ Object
readonly
Returns the value of attribute lm.
-
#sandbox ⇒ Object
readonly
Returns the value of attribute sandbox.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#signatures ⇒ Object
readonly
Returns the value of attribute signatures.
-
#skills ⇒ Object
readonly
Returns the value of attribute skills.
-
#sub_lm ⇒ Object
readonly
Returns the value of attribute sub_lm.
-
#tools ⇒ Object
readonly
Returns the value of attribute tools.
-
#trace_store ⇒ Object
readonly
Returns the value of attribute trace_store.
-
#validators ⇒ Object
readonly
Returns the value of attribute validators.
Instance Method Summary collapse
- #call(input = {}) ⇒ Object
-
#initialize(signature, lm: nil, sub_lm: nil, tools: [], skills: [], sandbox: nil, limits: nil, trace_store: nil, validators: [], signatures: []) ⇒ Predict
constructor
A new instance of Predict.
Constructor Details
#initialize(signature, lm: nil, sub_lm: nil, tools: [], skills: [], sandbox: nil, limits: nil, trace_store: nil, validators: [], signatures: []) ⇒ Predict
Returns a new instance of Predict.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rlm/predict.rb', line 8 def initialize( signature, lm: nil, sub_lm: nil, tools: [], skills: [], sandbox: nil, limits: nil, trace_store: nil, validators: [], signatures: [] ) raise ConfigurationError, "signature is required" if signature.nil? @signature = signature @lm = lm || RLM.config.root_lm @sub_lm = sub_lm || RLM.config.sub_lm @tools = Array(tools) @skills = Array(skills) @sandbox = sandbox || RLM.config.sandbox @limits = limits || RLM.config.default_limits @trace_store = trace_store || RLM.config.trace_store @validators = Array(validators) @signatures = signatures end |
Instance Attribute Details
#limits ⇒ Object (readonly)
Returns the value of attribute limits.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def limits @limits end |
#lm ⇒ Object (readonly)
Returns the value of attribute lm.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def lm @lm end |
#sandbox ⇒ Object (readonly)
Returns the value of attribute sandbox.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def sandbox @sandbox end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def signature @signature end |
#signatures ⇒ Object (readonly)
Returns the value of attribute signatures.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def signatures @signatures end |
#skills ⇒ Object (readonly)
Returns the value of attribute skills.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def skills @skills end |
#sub_lm ⇒ Object (readonly)
Returns the value of attribute sub_lm.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def sub_lm @sub_lm end |
#tools ⇒ Object (readonly)
Returns the value of attribute tools.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def tools @tools end |
#trace_store ⇒ Object (readonly)
Returns the value of attribute trace_store.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def trace_store @trace_store end |
#validators ⇒ Object (readonly)
Returns the value of attribute validators.
5 6 7 |
# File 'lib/rlm/predict.rb', line 5 def validators @validators end |
Instance Method Details
#call(input = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/rlm/predict.rb', line 34 def call(input = {}) Runtime.new( signature: signature, input: input, lm: lm, sub_lm: sub_lm, tools: tools, skills: skills, sandbox: sandbox, limits: limits, validators: validators, signatures: signatures, trace_store: trace_store ).call end |