Class: Raif::ModelTools::AgentFinalAnswer
- Inherits:
-
Raif::ModelTool
- Object
- Raif::ModelTool
- Raif::ModelTools::AgentFinalAnswer
- Defined in:
- app/models/raif/model_tools/agent_final_answer.rb
Class Method Summary collapse
Class Method Details
.observation_for_invocation(tool_invocation) ⇒ Object
20 21 22 23 24 |
# File 'app/models/raif/model_tools/agent_final_answer.rb', line 20 def observation_for_invocation(tool_invocation) return "No answer provided" unless tool_invocation.result.present? tool_invocation.result["final_answer"] end |
.process_invocation(tool_invocation) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'app/models/raif/model_tools/agent_final_answer.rb', line 26 def process_invocation(tool_invocation) tool_invocation.update!( result: { final_answer: tool_invocation.tool_arguments["final_answer"] } ) tool_invocation.result end |