class_docstr: Builder that can create text completions.
class_docstr_tok: ["Builder","that","can","create","text","completions","."]
docstr:         Creates a new text completion.
  
          :param model: model to be used, `None` means used the default model.
          :param prompt_type: type of the prompt
          :param input_context_for_instruction: input context for instruction
          :param enable_sampler: enable or disable the sampler, required for use of
                  temperature, top_p, top_k
          :param temperature: What sampling temperature to use, between 0 and 3.
                  Lower values will make it more focused and deterministic, but may lead
                  to repeat. Higher values will make the output more creative, but may
                  lead to hallucinations.
          :param top_p: cumulative probability of tokens to sample from
          :param top_k: number of tokens to sample from
          :param penalty_alpha: >0 and top_k>1 enable contrastive search (not all models support)
          :param beams: Number of searches for optimal overall probability.
                  Higher values uses more GPU memory and compute.
          :param early_stopping: whether to stop early or not in beam search
          :param min_output_length: minimum output length
          :param max_output_length: maximum output length
          :param max_time: maximum time to search optimal output
          :param repetition_penalty: penalty for repetition
          :param number_returns:
          :param system_pre_context: directly pre-appended without prompt processing
          :param langchain_mode: LangChain mode
          :param system_prompt: Universal system prompt to override prompt_type's system
                                prompt
                                If pass 'None' or 'auto' or None, then automatic per-model value used
          :param add_search_to_context: Whether to add web search of query to context
          :param text_context_list: list of strings to use as context (up to allowed max_seq_len of model)
          :param docs_ordering_type: By default uses 'reverse_ucurve_sort' for optimal retrieval
          :param min_max_new_tokens: minimum value for max_new_tokens when auto-adjusting for content of prompt, docs, etc.
          :param max_input_tokens: Max input tokens to place into model context for each LLM call
                                   -1 means auto, fully fill context for query, and fill by original document chunk for summarization
                                   >=0 means use that to limit context filling to that many tokens
          :param max_total_input_tokens: like max_input_tokens but instead of per LLM call, applies across all LLM calls for single summarization/extraction action
          :param docs_token_handling: 'chunk' means fill context with top_k_docs (limited by max_input_tokens or model_max_len) chunks for query
                                                                           or top_k_docs original document chunks summarization
                                      None or 'split_or_merge' means same as 'chunk' for query, while for summarization merges documents to fill up to max_input_tokens or model_max_len tokens
          :param docs_joiner: string to join lists of text when doing split_or_merge.  None means '
  
  '
          :param hyde_level: HYDE level for HYDE approach (https://arxiv.org/abs/2212.10496)
                       0: No HYDE
                       1: Use non-document-based LLM response and original query for embedding query
                       2: Use document-based LLM response and original query for embedding query
                       3+: Continue iterations of embedding prior answer and getting new response
          :param hyde_template:
                       None, 'None', 'auto' uses internal value and enable
                       '{query}' is minimal template one can pass
          :param hyde_show_only_final: See h2oGPT server docs
          :param doc_json_mode: whether to give JSON to LLM and get JSON response back
          :param chatbot_role: See h2oGPT server docs
          :param speaker: See h2oGPT server docs
          :param tts_language: See h2oGPT server docs
          :param tts_speed: See h2oGPT server docs
          
docstr_tok: ["Creates","a","new","text","completion",".",":","param","model",":","model","to","be","used",",","`","None","`","means","used","the","default","model",".",":","param","prompt_type",":","type","of","the","prompt",":","param","input_context_for_instruction",":","input","context","for","instruction",":","param","enable_sampler",":","enable","or","disable","the","sampler",",","required","for","use","of","temperature",",","top_p",",","top_k",":","param","temperature",":","What","sampling","temperature","to","use",",","between","0","and","3",".","Lower","values","will","make","it","more","focused","and","deterministic",",","but","may","lead","to","repeat",".","Higher","values","will","make","the","output","more","creative",",","but","may","lead","to","hallucinations",".",":","param","top_p",":","cumulative","probability","of","tokens","to","sample","from",":","param","top_k",":","number","of","tokens","to","sample","from",":","param","penalty_alpha",":",">","0","and","top_k",">","1","enable","contrastive","search","(","not","all","models","support",")",":","param","beams",":","Number","of","searches","for","optimal","overall","probability",".","Higher","values","uses","more","GPU","memory","and","compute",".",":","param","early_stopping",":","whether","to","stop","early","or","not","in","beam","search",":","param","min_output_length",":","minimum","output","length",":","param","max_output_length",":","maximum","output","length",":","param","max_time",":","maximum","time","to","search","optimal","output",":","param","repetition_penalty",":","penalty","for","repetition",":","param","number_returns",":",":","param","system_pre_context",":","directly","pre-appended","without","prompt","processing",":","param","langchain_mode",":","LangChain","mode",":","param","system_prompt",":","Universal","system","prompt","to","override","prompt_type","'s","system","prompt","If","pass","'None","'","or","'auto","'","or","None",",","then","automatic","per-model","value","used",":","param","add_search_to_context",":","Whether","to","add","web","search","of","query","to","context",":","param","text_context_list",":","list","of","strings","to","use","as","context","(","up","to","allowed","max_seq_len","of","model",")",":","param","docs_ordering_type",":","By","default","uses","'reverse_ucurve_sort","'","for","optimal","retrieval",":","param","min_max_new_tokens",":","minimum","value","for","max_new_tokens","when","auto-adjusting","for","content","of","prompt",",","docs",",","etc",".",":","param","max_input_tokens",":","Max","input","tokens","to","place","into","model","context","for","each","LLM","call","-1","means","auto",",","fully","fill","context","for","query",",","and","fill","by","original","document","chunk","for","summarization",">","=0","means","use","that","to","limit","context","filling","to","that","many","tokens",":","param","max_total_input_tokens",":","like","max_input_tokens","but","instead","of","per","LLM","call",",","applies","across","all","LLM","calls","for","single","summarization\/extraction","action",":","param","docs_token_handling",":","'chunk","'","means","fill","context","with","top_k_docs","(","limited","by","max_input_tokens","or","model_max_len",")","chunks","for","query","or","top_k_docs","original","document","chunks","summarization","None","or","'split_or_merge","'","means","same","as","'chunk","'","for","query",",","while","for","summarization","merges","documents","to","fill","up","to","max_input_tokens","or","model_max_len","tokens",":","param","docs_joiner",":","string","to","join","lists","of","text","when","doing","split_or_merge",".","None","means","'","'",":","param","hyde_level",":","HYDE","level","for","HYDE","approach","(","https",":","\/\/arxiv.org\/abs\/2212.10496",")","0",":","No","HYDE","1",":","Use","non-document-based","LLM","response","and","original","query","for","embedding","query","2",":","Use","document-based","LLM","response","and","original","query","for","embedding","query","3+",":","Continue","iterations","of","embedding","prior","answer","and","getting","new","response",":","param","hyde_template",":","None",",","'None","'",",","'auto","'","uses","internal","value","and","enable","'","{","query","}","'","is","minimal","template","one","can","pass",":","param","hyde_show_only_final",":","See","h2oGPT","server","docs",":","param","doc_json_mode",":","whether","to","give","JSON","to","LLM","and","get","JSON","response","back",":","param","chatbot_role",":","See","h2oGPT","server","docs",":","param","speaker",":","See","h2oGPT","server","docs",":","param","tts_language",":","See","h2oGPT","server","docs",":","param","tts_speed",":","See","h2oGPT","server","docs"]
code: def create(
      self,
      model: Union[None, Model, str] = None,
      prompt_type: PromptType = PromptType.plain,
      input_context_for_instruction: str = "",
      enable_sampler=False,
      temperature: float = 0.1,
      top_p: float = 1.0,
      top_k: int = 40,
      penalty_alpha: float = 0.0,
      beams: float = 1.0,
      early_stopping: bool = False,
      min_output_length: int = 0,
      max_output_length: int = 1024,
      max_time: int = 360,
      repetition_penalty: float = 1.07,
      number_returns: int = 1,
      system_pre_context: str = "",
      langchain_mode: LangChainMode = LangChainMode.DISABLED,
      system_prompt: str = "",
      add_search_to_context: bool = False,
      text_context_list: List[str] = [],
      docs_ordering_type: str = "reverse_ucurve_sort",
      min_max_new_tokens: int = 256,
      max_input_tokens: int = -1,
      max_total_input_tokens: int = -1,
      docs_token_handling: str = "split_or_merge",
      docs_joiner: str = "\n\n",
      hyde_level: int = 0,
      hyde_template: Optional[str] = None,
      hyde_show_only_final: bool = False,
      doc_json_mode: bool = False,
      chatbot_role="None",
      speaker="None",
      tts_language="autodetect",
      tts_speed=1.0,
  ) -> "TextCompletion":
      """
      Creates a new text completion.
  
      :param model: model to be used, `None` means used the default model.
      :param prompt_type: type of the prompt
      :param input_context_for_instruction: input context for instruction
      :param enable_sampler: enable or disable the sampler, required for use of
              temperature, top_p, top_k
      :param temperature: What sampling temperature to use, between 0 and 3.
              Lower values will make it more focused and deterministic, but may lead
              to repeat. Higher values will make the output more creative, but may
              lead to hallucinations.
      :param top_p: cumulative probability of tokens to sample from
      :param top_k: number of tokens to sample from
      :param penalty_alpha: >0 and top_k>1 enable contrastive search (not all models support)
      :param beams: Number of searches for optimal overall probability.
              Higher values uses more GPU memory and compute.
      :param early_stopping: whether to stop early or not in beam search
      :param min_output_length: minimum output length
      :param max_output_length: maximum output length
      :param max_time: maximum time to search optimal output
      :param repetition_penalty: penalty for repetition
      :param number_returns:
      :param system_pre_context: directly pre-appended without prompt processing
      :param langchain_mode: LangChain mode
      :param system_prompt: Universal system prompt to override prompt_type's system
                            prompt
                            If pass 'None' or 'auto' or None, then automatic per-model value used
      :param add_search_to_context: Whether to add web search of query to context
      :param text_context_list: list of strings to use as context (up to allowed max_seq_len of model)
      :param docs_ordering_type: By default uses 'reverse_ucurve_sort' for optimal retrieval
      :param min_max_new_tokens: minimum value for max_new_tokens when auto-adjusting for content of prompt, docs, etc.
      :param max_input_tokens: Max input tokens to place into model context for each LLM call
                               -1 means auto, fully fill context for query, and fill by original document chunk for summarization
                               >=0 means use that to limit context filling to that many tokens
      :param max_total_input_tokens: like max_input_tokens but instead of per LLM call, applies across all LLM calls for single summarization/extraction action
      :param docs_token_handling: 'chunk' means fill context with top_k_docs (limited by max_input_tokens or model_max_len) chunks for query
                                                                       or top_k_docs original document chunks summarization
                                  None or 'split_or_merge' means same as 'chunk' for query, while for summarization merges documents to fill up to max_input_tokens or model_max_len tokens
      :param docs_joiner: string to join lists of text when doing split_or_merge.  None means '\n\n'
      :param hyde_level: HYDE level for HYDE approach (https://arxiv.org/abs/2212.10496)
                   0: No HYDE
                   1: Use non-document-based LLM response and original query for embedding query
                   2: Use document-based LLM response and original query for embedding query
                   3+: Continue iterations of embedding prior answer and getting new response
      :param hyde_template:
                   None, 'None', 'auto' uses internal value and enable
                   '{query}' is minimal template one can pass
      :param hyde_show_only_final: See h2oGPT server docs
      :param doc_json_mode: whether to give JSON to LLM and get JSON response back
      :param chatbot_role: See h2oGPT server docs
      :param speaker: See h2oGPT server docs
      :param tts_language: See h2oGPT server docs
      :param tts_speed: See h2oGPT server docs
      """
      args = locals().copy()
      args[
          "prompt_type"
      ] = prompt_type.value  # convert to serializable type
      args[
          "langchain_mode"
      ] = langchain_mode.value  # convert to serializable type
      params = _to_h2ogpt_params({**_DEFAULT_PARAMETERS, **args})
      params["instruction_nochat"] = None  # future prompt
      params["h2ogpt_key"] = self._client.h2ogpt_key
      return TextCompletion(self._client, params)
  
imports: import abc
  import ast
  import collections
  from typing import Any, AsyncGenerator, Dict, Generator, List, Optional, OrderedDict, Union
  from h2ogpt_client._gradio_client import GradioClientWrapper
  from h2ogpt_client._h2ogpt_enums import DocumentSubset, LangChainAction, LangChainMode, PromptType
  from h2ogpt_client._models import Model
label_desc: Use image node_id 2 for calling the TextCompletionCreator obj's underlying member method code with example usage: obj.create(model, prompt_type, input_context_for_instruction, enable_sampler, temperature, top_p, top_k, penalty_alpha, beams, early_stopping, min_output_length, max_output_length, max_time, repetition_penalty, number_returns, system_pre_context, langchain_mode, system_prompt, add_search_to_context, text_context_list, docs_ordering_type, min_max_new_tokens, max_input_tokens, max_total_input_tokens, docs_token_handling, docs_joiner, hyde_level, hyde_template, hyde_show_only_final, doc_json_mode, chatbot_role, speaker, tts_language, tts_speed) and returns: TextCompletion