class_docstr: Automatically dispatch to the proper `Client` based on the organization.
class_docstr_tok: ["Automatically","dispatch","to","the","proper","`","Client","`","based","on","the","organization","."]
docstr: Dispatch based on the the name of the model (e.g., openai/davinci).
  Retries if request fails.
docstr_tok: ["Dispatch","based","on","the","the","name","of","the","model","(","e.g.",",","openai\/davinci",")",".","Retries","if","request","fails","."]
code: def make_request(self, request: Request) -> RequestResult:
      """
      Dispatch based on the the name of the model (e.g., openai/davinci).
      Retries if request fails.
      """
  
      # TODO: need to revisit this because this swallows up any exceptions that are raised.
      @retry_request
      def make_request_with_retry(
          client: Client, request: Request
      ) -> RequestResult:
          return client.make_request(request)
  
      client: Client = self._get_client(request.model)
  
      try:
          return make_request_with_retry(client=client, request=request)
      except RetryError as e:
          last_attempt: Attempt = e.last_attempt
          retry_error: str = f"Failed to make request to {request.model} after retrying {last_attempt.attempt_number} times"
          hlog(retry_error)
  
          # Notify our user that we failed to make the request even after retrying.
          return replace(
              last_attempt.value,
              error=f"{retry_error}. Error: {last_attempt.value.error}",
          )
  
imports: import os
  from dataclasses import replace
  from typing import Dict, Optional
  from retrying import RetryError, Attempt
  from helm.common.cache import CacheConfig, MongoCacheConfig, SqliteCacheConfig
  from helm.common.hierarchical_logger import hlog
  from helm.common.request import Request, RequestResult
  from helm.common.tokenization_request import TokenizationRequest, TokenizationRequestResult, DecodeRequest, DecodeRequestResult
  from helm.proxy.retry import retry_request
  from .critique_client import CritiqueClient, RandomCritiqueClient, SurgeAICritiqueClient
  from .mechanical_turk_critique_client import MechanicalTurkCritiqueClient
  from .client import Client
  from .ai21_client import AI21Client
  from .aleph_alpha_client import AlephAlphaClient
  from .anthropic_client import AnthropicClient
  from .chat_gpt_client import ChatGPTClient
  from .cohere_client import CohereClient
  from .together_client import TogetherClient
  from .google_client import GoogleClient
  from .goose_ai_client import GooseAIClient
  from .huggingface_client import HuggingFaceClient
  from .ice_tokenizer_client import ICETokenizerClient
  from .megatron_client import MegatronClient
  from .openai_client import OpenAIClient
  from .microsoft_client import MicrosoftClient
  from .perspective_api_client import PerspectiveAPIClient
  from .palmyra_client import PalmyraClient
  from .yalm_tokenizer_client import YaLMTokenizerClient
  from .simple_client import SimpleClient
  from helm.proxy.clients.huggingface_model_registry import get_huggingface_model_config
label_desc: Use image node_id 4 for calling the AutoClient obj's underlying member method code with example usage: obj.make_request(request) and returns: client, make_request_with_retry, replace