From 3f693ea060d96b0adc397768c3b2dd47708a20ce Mon Sep 17 00:00:00 2001 From: sigoden Date: Mon, 4 Mar 2024 11:08:59 +0800 Subject: feat: compress session automaticlly (#333) * feat: compress session automaticlly * non-block * update field description * set compress_threshold * update session::clear_messages * able to override session compress_threshold * enable compress_threshold by default * make session compress_threshold optional --- config.example.yaml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config.example.yaml') diff --git a/config.example.yaml b/config.example.yaml index e510734..69220f1 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -9,6 +9,13 @@ auto_copy: false # Automatically copy the last output to the cli keybindings: emacs # REPL keybindings. (emacs, vi) prelude: '' # Set a default role or session (role:, session:) +# Compress session if tokens exceed this value (valid when >=1000) +compress_threshold: 1000 +# The prompt for summarizing session messages +summarize_prompt: 'Summarize the discussion briefly in 200 words or less to use as a prompt for future context.' +# The prompt for the summary of the session +summary_prompt: 'This is a summary of the chat history as a recap: ' + # Custom REPL prompt, see https://github.com/sigoden/aichat/wiki/Custom-REPL-Prompt left_prompt: '{color.green}{?session {session}{?role /}}{role}{color.cyan}{?session )}{!session >}{color.reset} ' right_prompt: '{color.purple}{?session {?consume_tokens {consume_tokens}({consume_percent}%)}{!consume_tokens {consume_tokens}}}{color.reset}' -- cgit v1.2.3