Exception: RubyLLM::ToolCallParseError
- Defined in:
- lib/ruby_llm/error.rb
Overview
Raised when a provider returns tool-call arguments that are not valid JSON, often because the response was truncated mid-tool-call.
Instance Attribute Summary collapse
-
#finish_reason ⇒ Object
readonly
Returns the normalized reason generation stopped, or
nil.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message = nil, response: nil, finish_reason: nil) ⇒ ToolCallParseError
constructor
:nodoc:.
Methods inherited from Error
Constructor Details
#initialize(message = nil, response: nil, finish_reason: nil) ⇒ ToolCallParseError
:nodoc:
132 133 134 135 136 137 |
# File 'lib/ruby_llm/error.rb', line 132 def initialize( = nil, response: nil, finish_reason: nil) # :nodoc: @finish_reason = finish_reason ||= 'Provider returned malformed tool call arguments' = "#{} (finish_reason: #{finish_reason})" if finish_reason super(, response: response) end |
Instance Attribute Details
#finish_reason ⇒ Object (readonly)
Returns the normalized reason generation stopped, or nil.
130 131 132 |
# File 'lib/ruby_llm/error.rb', line 130 def finish_reason @finish_reason end |