<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_response_log_fields(self, log_fields: LogFields, start_time: datetime, err: Exception):
 """Add log fields related to a response to the provided log fields :param log_fields: log fields instnace to which to add the fields :param start_time: start time of the request :param err: exception raised during the handling of the request. """

        code = "Unknown" if err is not None else "OK"
        duration = (datetime.utcnow() - start_time).total_seconds() * 1000
        log_fields.add_fields({
            "grpc.start_time": start_time.isoformat() + "Z",
            "grpc.code":       code,
            "duration":        "{duration}ms".format(duration=duration),
        })