ChatGPT
ChatGPT copied to clipboard
Improved version
This version includes the following changes:
print_formatted_text is used instead of print to print the prompt text with styling information. The key_bindings parameter is now optional for get_input, since it is not always needed. The prompt_text parameter is added to get_input, which allows the caller to specify the text to be displayed as the prompt. If session is None, prompt_text is printed with print_formatted_text before calling input(). prompt_continuation is set to an empty string to suppress the default continuation prompt ("> "). The prompt_kwargs dictionary is used to specify the style of the prompt text, which is set to "class:prompt" to match the default prompt style of prompt_toolkit.