Class: SmartAgent::Result
- Inherits:
-
Object
- Object
- SmartAgent::Result
- Defined in:
- lib/smart_agent/result.rb
Instance Method Summary collapse
- #call_tools ⇒ Object
- #content ⇒ Object
-
#initialize(response) ⇒ Result
constructor
A new instance of Result.
- #response ⇒ Object
Constructor Details
#initialize(response) ⇒ Result
Returns a new instance of Result.
3 4 5 6 |
# File 'lib/smart_agent/result.rb', line 3 def initialize(response) SmartAgent.logger.info("response is:" + response.to_s) @response = response end |
Instance Method Details
#call_tools ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/smart_agent/result.rb', line 8 def call_tools if @response.class == String return nil else @response.dig("choices", 0, "message", "tool_calls") end end |
#content ⇒ Object
16 17 18 |
# File 'lib/smart_agent/result.rb', line 16 def content @response.dig("choices", 0, "message", "content") end |
#response ⇒ Object
20 21 22 |
# File 'lib/smart_agent/result.rb', line 20 def response @response end |