code: def model_to_completions(cls, resp, config):
      return completions.ResponsePayload(
          created=int(time.time()),
          object="text_completion",
          model=config.model.name,
          choices=[
              completions.Choice(
                  index=idx,
                  text=candidate.get("data", {}).get("text"),
                  finish_reason=None,
              )
              for idx, candidate in enumerate(
                  resp.get("completions", [])
              )
          ],
          usage=completions.CompletionsUsage(
              prompt_tokens=None,
              completion_tokens=None,
              total_tokens=None,
          ),
      )
  
imports: import json
  import time
  from enum import Enum
  import boto3
  import botocore.config
  import botocore.exceptions
  from fastapi import HTTPException
  from fastapi.encoders import jsonable_encoder
  from mlflow.gateway.config import AWSBedrockConfig, AWSIdAndKey, AWSRole, RouteConfig
  from mlflow.gateway.constants import MLFLOW_AI_GATEWAY_ANTHROPIC_DEFAULT_MAX_TOKENS
  from mlflow.gateway.exceptions import AIGatewayConfigException
  from mlflow.gateway.providers.anthropic import AnthropicAdapter
  from mlflow.gateway.providers.base import BaseProvider, ProviderAdapter
  from mlflow.gateway.providers.cohere import CohereAdapter
  from mlflow.gateway.providers.utils import rename_payload_keys
  from mlflow.gateway.schemas import chat, completions, embeddings
label_desc: Use image node_id 2 for calling the AI21Adapter obj's underlying member method code with example usage: obj.model_to_completions(cls, resp, config) and returns: completions