ChatGPT CLI is a versatile tool for interacting with LLM models through OpenAI and Azure, as well as models from Perplexity AI and Llama. It supports prompts and history tracking for seamless, context-aware interactions. With extensive configuration options, it’s designed for both users and developers to create a customized GPT experience.
This PR introduces the ability to use dynamic variables in the command prompt for interactive mode in the ChatGPT CLI. The following variables have been added:
%date: The current date in the format YYYY-MM-DD.
%time: The current time in the format HH:MM:SS.
%datetime: The current date and time in the format YYYY-MM-DD HH:MM:SS.
%counter: The current counter value.
%usage: The current usage value.
Changes:
Updated the README to reflect the new variables.
Modified the main file to utilize the new FormatPrompt function for dynamic command prompts.
Added unit tests for the FormatPrompt function to ensure correctness.
Set the default command prompt to [datetime] [Qcounter] in the configuration store.
Implementation:
config/utils.go: Added FormatPrompt function to handle dynamic prompt formatting.
config/utils_test.go: Added unit tests for FormatPrompt.
cmd/chatgpt/main.go: Updated to use the FormatPrompt function.
config/store.go: Set the default command prompt to [datetime] [Qcounter].
README.md: Documented the new variables and updated the Table of Contents.
Summary:
This PR introduces the ability to use dynamic variables in the command prompt for interactive mode in the ChatGPT CLI. The following variables have been added:
%date
: The current date in the formatYYYY-MM-DD
.%time
: The current time in the formatHH:MM:SS
.%datetime
: The current date and time in the formatYYYY-MM-DD HH:MM:SS
.%counter
: The current counter value.%usage
: The current usage value.Changes:
FormatPrompt
function for dynamic command prompts.FormatPrompt
function to ensure correctness.[datetime] [Qcounter]
in the configuration store.Implementation:
config/utils.go
: AddedFormatPrompt
function to handle dynamic prompt formatting.config/utils_test.go
: Added unit tests forFormatPrompt
.cmd/chatgpt/main.go
: Updated to use theFormatPrompt
function.config/store.go
: Set the default command prompt to[datetime] [Qcounter]
.README.md
: Documented the new variables and updated the Table of Contents.