code: def embedding(
      model: str,
      input: list,
      api_key: Optional[str] = None,
      logging_obj=None,
      model_response=None,
      encoding=None,
      optional_params=None,
  ):
      headers = validate_environment(api_key)
      embed_url = "https://api.cohere.ai/v1/embed"
      model = model
      data = {"model": model, "texts": input, **optional_params}
  
      if "3" in model and "input_type" not in data:
          # cohere v3 embedding models require input_type, if no input_type is provided, default to "search_document"
          data["input_type"] = "search_document"
  
      ## LOGGING
      logging_obj.pre_call(
          input=input,
          api_key=api_key,
          additional_args={"complete_input_dict": data},
      )
      ## COMPLETION CALL
      response = requests.post(
          embed_url, headers=headers, data=json.dumps(data)
      )
      ## LOGGING
      logging_obj.post_call(
          input=input,
          api_key=api_key,
          additional_args={"complete_input_dict": data},
          original_response=response,
      )
      """
          response 
          {
              'object': "list",
              'data': [
              
              ]
              'model', 
              'usage'
          }
      """
      if response.status_code != 200:
          raise CohereError(
              message=response.text, status_code=response.status_code
          )
      embeddings = response.json()["embeddings"]
      output_data = []
      for idx, embedding in enumerate(embeddings):
          output_data.append(
              {
                  "object": "embedding",
                  "index": idx,
                  "embedding": embedding,
              }
          )
      model_response["object"] = "list"
      model_response["data"] = output_data
      model_response["model"] = model
      input_tokens = 0
      for text in input:
          input_tokens += len(encoding.encode(text))
  
      model_response["usage"] = {
          "prompt_tokens": input_tokens,
          "total_tokens": input_tokens,
      }
      return model_response
  
file_path: litellm/litellm/llms/cohere.py
imports: import os, types
  import json
  from enum import Enum
  import requests
  import time, traceback
  from typing import Callable, Optional
  from litellm.utils import ModelResponse, Choices, Message, Usage
  import litellm
  import httpx
label_desc: Use image node_id 3 for calling a global function with example usage: embedding(model, input, api_key, logging_obj, model_response, encoding, optional_params) and returns: model_response