Create standardized ChatResult for errors.
create_chat_error_result(
error: Exception,
operation: str,
model: str,
input_tokens: int = 0,
logger_instance: Optional[logging.Logger] = None
) -> ChatResult| Name | Type | Description |
|---|---|---|
error* | Exception | The exception that occurred |
operation* | str | Description of the operation that failed |
model* | str | Model name for metadata |
input_tokens | int | Default: 0Number of input tokens for usage metadata |
logger_instance | Optional[logging.Logger] | Default: NoneSpecific logger to use (defaults to module logger) |