class_docstr: A wrapper class for openai client.
docstr: Prime the create_config with additional_kwargs.
docstr_tok: ["Prime","the","create_config","with","additional_kwargs","."]
code: def _construct_create_params(
      self, create_config: Dict[str, Any], extra_kwargs: Dict[str, Any]
  ) -> Dict[str, Any]:
      """Prime the create_config with additional_kwargs."""
      # Validate the config
      prompt: Optional[str] = create_config.get("prompt")
      messages: Optional[List[Dict[str, Any]]] = create_config.get(
          "messages"
      )
      if (prompt is None) == (messages is None):
          raise ValueError(
              "Either prompt or messages should be in create config but not both."
          )
      context = extra_kwargs.get("context")
      if context is None:
          # No need to instantiate if no context is provided.
          return create_config
      # Instantiate the prompt or messages
      allow_format_str_template = extra_kwargs.get(
          "allow_format_str_template", False
      )
      # Make a copy of the config
      params = create_config.copy()
      if prompt is not None:
          # Instantiate the prompt
          params["prompt"] = self.instantiate(
              prompt, context, allow_format_str_template
          )
      elif context:
          # Instantiate the messages
          params["messages"] = [
              {
                  **m,
                  "content": self.instantiate(
                      m["content"], context, allow_format_str_template
                  ),
              }
              if m.get("content")
              else m
              for m in messages  # type: ignore [union-attr]
          ]
      return params
  
imports: from __future__ import annotations
  import os
  import sys
  from typing import Any, List, Optional, Dict, Callable, Tuple, Union
  import logging
  import inspect
  from flaml.automl.logger import logger_formatter
  from pydantic import BaseModel
  from autogen.oai import completion
  from autogen.oai.openai_utils import DEFAULT_AZURE_API_VERSION, get_key, OAI_PRICE1K
  from autogen.token_count_utils import count_token
  from autogen._pydantic import model_dump
label_desc: Use image node_id 6 for calling the OpenAIWrapper obj's underlying member method code with example usage: obj._construct_create_params(create_config, extra_kwargs) and returns: params, create_config