class_docstr: Text completion.
class_docstr_tok: ["Text","completion","."]
docstr: Complete this text completion synchronously.
  
  :param prompt: text prompt to generate completion for
  :param enable_streaming: whether to enable or disable streaming the response
  :return: response from the model
docstr_tok: ["Complete","this","text","completion","synchronously",".",":","param","prompt",":","text","prompt","to","generate","completion","for",":","param","enable_streaming",":","whether","to","enable","or","disable","streaming","the","response",":","return",":","response","from","the","model"]
code: def complete_sync(
      self, prompt: str, enable_streaming: bool = False
  ) -> Union[str, Generator[str, None, None]]:
      """
      Complete this text completion synchronously.
  
      :param prompt: text prompt to generate completion for
      :param enable_streaming: whether to enable or disable streaming the response
      :return: response from the model
      """
      if enable_streaming:
          params = self._get_parameters(prompt)
          params["stream_output"] = True
          return self._predict_and_stream(prompt)
      else:
          return self._predict(prompt)
  
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 1 for calling the TextCompletion obj's underlying member method code with example usage: obj.complete_sync(prompt, enable_streaming) and returns: self, self