Class: Prescient::Agent::ErrorSerializer
- Inherits:
-
Object
- Object
- Prescient::Agent::ErrorSerializer
- Defined in:
- lib/prescient/agent/error_serializer.rb
Overview
Converts provider and tool failures into bounded, safe agent data.
Constant Summary collapse
- CATEGORY_MAP =
Returns Provider/tool error categories.
[ [Prescient::AuthenticationError, "authentication_failed"], [Prescient::ConnectionError, "provider_unavailable"], [Prescient::RateLimitError, "rate_limited"], [Prescient::ModelNotAvailableError, "model_unavailable"], [Prescient::InvalidResponseError, "invalid_provider_response"], [Prescient::ProviderError, "provider_failure"], [Prescient::ToolConfigurationError, "tool_configuration_error"], [Prescient::ToolConnectionError, "tool_unavailable"], [Prescient::ToolInvalidResponseError, "invalid_tool_response"], [Prescient::ToolError, "tool_failure"] ].freeze
Class Method Summary collapse
-
.serialize(error) ⇒ Hash
Safe error envelope.
Class Method Details
.serialize(error) ⇒ Hash
Returns Safe error envelope.
24 25 26 27 28 29 30 31 |
# File 'lib/prescient/agent/error_serializer.rb', line 24 def serialize(error) { error: { category: category_for(error), message: (error) } } end |