Class: Copilot::ToolResult
- Inherits:
-
Struct
- Object
- Struct
- Copilot::ToolResult
- Defined in:
- lib/copilot/types.rb
Overview
The result of a tool invocation. Can be constructed directly or returned as a plain Hash / String from a handler.
Instance Attribute Summary collapse
-
#binary_results_for_llm ⇒ Object
Returns the value of attribute binary_results_for_llm.
-
#error ⇒ Object
Returns the value of attribute error.
-
#result_type ⇒ Object
Returns the value of attribute result_type.
-
#session_log ⇒ Object
Returns the value of attribute session_log.
-
#text_result_for_llm ⇒ Object
Returns the value of attribute text_result_for_llm.
-
#tool_telemetry ⇒ Object
Returns the value of attribute tool_telemetry.
Instance Method Summary collapse
Instance Attribute Details
#binary_results_for_llm ⇒ Object
Returns the value of attribute binary_results_for_llm
39 40 41 |
# File 'lib/copilot/types.rb', line 39 def binary_results_for_llm @binary_results_for_llm end |
#error ⇒ Object
Returns the value of attribute error
39 40 41 |
# File 'lib/copilot/types.rb', line 39 def error @error end |
#result_type ⇒ Object
Returns the value of attribute result_type
39 40 41 |
# File 'lib/copilot/types.rb', line 39 def result_type @result_type end |
#session_log ⇒ Object
Returns the value of attribute session_log
39 40 41 |
# File 'lib/copilot/types.rb', line 39 def session_log @session_log end |
#text_result_for_llm ⇒ Object
Returns the value of attribute text_result_for_llm
39 40 41 |
# File 'lib/copilot/types.rb', line 39 def text_result_for_llm @text_result_for_llm end |
#tool_telemetry ⇒ Object
Returns the value of attribute tool_telemetry
39 40 41 |
# File 'lib/copilot/types.rb', line 39 def tool_telemetry @tool_telemetry end |
Instance Method Details
#to_h ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/copilot/types.rb', line 44 def to_h h = { textResultForLlm: text_result_for_llm, resultType: result_type || ToolResultType::SUCCESS, } h[:binaryResultsForLlm] = binary_results_for_llm.map(&:to_h) if binary_results_for_llm h[:error] = error if error h[:sessionLog] = session_log if session_log h[:toolTelemetry] = tool_telemetry || {} h end |