code: def model_to_completions(cls, resp, config):
      # Response example (https://docs.cohere.com/reference/generate)
      # ```
      # {
      #   "id": "string",
      #   "generations": [
      #     {
      #       "id": "string",
      #       "text": "string"
      #     }
      #   ],
      #   "prompt": "string"
      # }
      # ```
      return completions.ResponsePayload(
          created=int(time.time()),
          object="text_completion",
          model=config.model.name,
          choices=[
              completions.Choice(
                  index=idx,
                  text=c["text"],
                  finish_reason=None,
              )
              for idx, c in enumerate(resp["generations"])
          ],
          usage=completions.CompletionsUsage(
              prompt_tokens=None,
              completion_tokens=None,
              total_tokens=None,
          ),
      )
  
file_path: mlflow/mlflow/gateway/providers/cohere.py
imports: import time
  from typing import Any, Dict
  from fastapi import HTTPException
  from fastapi.encoders import jsonable_encoder
  from mlflow.gateway.config import CohereConfig, RouteConfig
  from mlflow.gateway.providers.base import BaseProvider, ProviderAdapter
  from mlflow.gateway.providers.utils import rename_payload_keys, send_request
  from mlflow.gateway.schemas import chat, completions, embeddings
label_desc: Use image node_id 1 for calling the CohereAdapter obj's underlying member method code with example usage: obj.model_to_completions(cls, resp, config) and returns: completions