code: def helper_prod_test_service(request: Request, expected_text: str):
      """Make a `request` to the production server."""
      service = get_prod_service()
      auth = get_authentication()
      result = service.make_request(auth, request)
      print(result)
      assert result.success
      assert len(result.completions) == request.num_completions
  
      for completion in result.completions:
          # Make sure the token text builds the same as the top-level text
          assert (
              "".join(token.text for token in completion.tokens)
              == completion.text
          )
  
          # Check echo is working
          if request.echo_prompt:
              assert completion.text.startswith(request.prompt)
  
          # Don't generate too many tokens
          if not request.echo_prompt:
              assert len(completion.tokens) <= request.max_tokens
  
          # Consistency of log probs
          assert completion.logprob == sum(
              token.logprob for token in completion.tokens
          )
  
          for token in completion.tokens[1:]:
              assert len(token.top_logprobs) == request.top_k_per_token
  
              # If generated token was one of the top, make sure has the right probability
              if token.text in token.top_logprobs:
                  assert token.logprob == token.top_logprobs[token.text]
  
              # If temperature = 0, then make sure we're getting the top probability token
              if request.temperature == 0:
                  assert token.text in token.top_logprobs
                  assert token.logprob == max(
                      token.top_logprobs.values()
                  )
  
      # Make sure we get the expected_text in one of the completions
      assert any(
          completion.text == expected_text
          for completion in result.completions
      )
  
imports: import copy
  import pytest
  import shutil
  import tempfile
  from helm.common.authentication import Authentication
  from helm.common.request import Request
  from helm.proxy.accounts import AuthenticationError, Accounts
  from helm.proxy.query import Query
  from .server_service import ServerService
label_desc: Use image node_id 3 for calling a global function with example usage: helper_prod_test_service(request, expected_text) without return types