class RubyLLM::InputRequest::Answer
What the user said to a toolβs own question (Tool#ask): accepted with values, or declined. Read a value with [].
Public Instance Methods
Source
# File lib/ruby_llm/input_request.rb, line 41 def [](name) @response.fetch('content', nil).to_h.transform_keys(&:to_s)[name.to_s] end
The value given for the field name, or nil.
Source
# File lib/ruby_llm/input_request.rb, line 31 def accepted? @response['action'] == 'accept' end
Returns whether the user answered the question.
Source
# File lib/ruby_llm/input_request.rb, line 36 def declined? !accepted? end
Returns whether the user declined the question.
Source
# File lib/ruby_llm/input_request.rb, line 47 def to_h @response.fetch('content', nil).to_h.transform_keys(&:to_sym) end
Returns the values given, by field name as Symbols, or an empty Hash for a declined question or a page to visit.