Class: Envoy::ToolCall
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Envoy::ToolCall
- Defined in:
- app/models/envoy/tool_call.rb
Instance Method Summary collapse
-
#outcome ⇒ Object
Derive a governance outcome from the persisted result, tolerant of how the result content was serialized.
-
#result_message ⇒ Object
The tool-result message that answers this call (role "tool").
Instance Method Details
#outcome ⇒ Object
Derive a governance outcome from the persisted result, tolerant of how the result content was serialized. Returns :denied / :failed / :succeeded.
12 13 14 15 16 |
# File 'app/models/envoy/tool_call.rb', line 12 def outcome payload = parsed_result return :succeeded unless payload.is_a?(Hash) && payload["error"] payload["type"] == "forbidden" ? :denied : :failed end |