class_docstr: A wrapper around `Service` that makes only necessary server requests when calculating metrics.
class_docstr_tok: ["A","wrapper","around","`","Service","`","that","makes","only","necessary","server","requests","when","calculating","metrics","."]
code: def get_toxicity_scores(
      self, request: PerspectiveAPIRequest
  ) -> PerspectiveAPIRequestResult:
      return self._service.get_toxicity_scores(self._auth, request)
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/metrics/metric_service.py
imports: from typing import Optional
  from helm.common.authentication import Authentication
  from helm.common.critique_request import CritiqueRequest, CritiqueRequestResult
  from helm.common.perspective_api_request import PerspectiveAPIRequest, PerspectiveAPIRequestResult
  from helm.benchmark.window_services.tokenizer_service import TokenizerService
  from helm.proxy.services.service import Service
label_desc: Use image node_id 2 for calling the MetricService obj's underlying member method code with example usage: obj.get_toxicity_scores(request) and returns: self