Exception: DSPy::ReAct::MaxIterationsError
- Inherits:
-
StandardError
- Object
- StandardError
- DSPy::ReAct::MaxIterationsError
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/re_act.rb
Overview
Custom error classes
Instance Attribute Summary collapse
-
#history ⇒ Object
readonly
Returns the value of attribute history.
-
#iterations ⇒ Object
readonly
Returns the value of attribute iterations.
-
#last_observation ⇒ Object
readonly
Returns the value of attribute last_observation.
-
#max_iterations ⇒ Object
readonly
Returns the value of attribute max_iterations.
-
#partial_final_answer ⇒ Object
readonly
Returns the value of attribute partial_final_answer.
-
#tools_used ⇒ Object
readonly
Returns the value of attribute tools_used.
Instance Method Summary collapse
-
#initialize(message = "Agent reached maximum iterations without producing a final answer", iterations: nil, max_iterations: nil, tools_used: [], history: [], last_observation: nil, partial_final_answer: nil) ⇒ MaxIterationsError
constructor
A new instance of MaxIterationsError.
Constructor Details
#initialize(message = "Agent reached maximum iterations without producing a final answer", iterations: nil, max_iterations: nil, tools_used: [], history: [], last_observation: nil, partial_final_answer: nil) ⇒ MaxIterationsError
Returns a new instance of MaxIterationsError.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/dspy/re_act.rb', line 82 def initialize( = "Agent reached maximum iterations without producing a final answer", iterations: nil, max_iterations: nil, tools_used: [], history: [], last_observation: nil, partial_final_answer: nil ) @iterations = T.let(iterations, T.nilable(Integer)) @max_iterations = T.let(max_iterations, T.nilable(Integer)) @tools_used = T.let(tools_used, T::Array[String]) @history = T.let(history, T::Array[T::Hash[Symbol, T.untyped]]) @last_observation = last_observation @partial_final_answer = partial_final_answer super() end |
Instance Attribute Details
#history ⇒ Object (readonly)
Returns the value of attribute history.
63 64 65 |
# File 'lib/dspy/re_act.rb', line 63 def history @history end |
#iterations ⇒ Object (readonly)
Returns the value of attribute iterations.
54 55 56 |
# File 'lib/dspy/re_act.rb', line 54 def iterations @iterations end |
#last_observation ⇒ Object (readonly)
Returns the value of attribute last_observation.
66 67 68 |
# File 'lib/dspy/re_act.rb', line 66 def last_observation @last_observation end |
#max_iterations ⇒ Object (readonly)
Returns the value of attribute max_iterations.
57 58 59 |
# File 'lib/dspy/re_act.rb', line 57 def max_iterations @max_iterations end |
#partial_final_answer ⇒ Object (readonly)
Returns the value of attribute partial_final_answer.
69 70 71 |
# File 'lib/dspy/re_act.rb', line 69 def partial_final_answer @partial_final_answer end |
#tools_used ⇒ Object (readonly)
Returns the value of attribute tools_used.
60 61 62 |
# File 'lib/dspy/re_act.rb', line 60 def tools_used @tools_used end |