pub fn error_to_api_message(
error_msg: &str,
status: Option<u16>,
) -> ApiErrorMessageExpand description
Map a raw error message to a rich ApiErrorMessage with structured content,
error type, and optional error_details. Mirrors the TypeScript
getAssistantMessageFromError() function.