Add type inference to google doc context getter