refactor: minior improvement (#633)

pull/634/head
sigoden 3 months ago committed by GitHub
parent 0ec370b48c
commit 3826d808d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4,7 +4,7 @@
[![Crates](https://img.shields.io/crates/v/aichat.svg)](https://crates.io/crates/aichat) [![Crates](https://img.shields.io/crates/v/aichat.svg)](https://crates.io/crates/aichat)
[![Discord](https://img.shields.io/discord/1226737085453701222?label=Discord)](https://discord.gg/mr3ZZUB9hG) [![Discord](https://img.shields.io/discord/1226737085453701222?label=Discord)](https://discord.gg/mr3ZZUB9hG)
AIChat is an all-in-one AI CLI tool featuring chat REPL, RAG, function calling, agents, and more. AIChat is an all-in-one AI CLI tool featuring Chat-REPL, RAG, Function Calling, AI Agents, and more.
![AIChat Command](https://github.com/sigoden/aichat/assets/4012553/84ae8382-62be-41d0-a0f1-101b113c5bc7) ![AIChat Command](https://github.com/sigoden/aichat/assets/4012553/84ae8382-62be-41d0-a0f1-101b113c5bc7)

@ -1,31 +1,46 @@
# ---- llm ----
model: openai:gpt-3.5-turbo # Specify the language model to use model: openai:gpt-3.5-turbo # Specify the language model to use
temperature: null # Set default temperature parameter temperature: null # Set default temperature parameter
top_p: null # Set default top-p parameter top_p: null # Set default top-p parameter
save: true # Indicates whether to persist the message
save_session: null # Controls the persistence of the session, if null, asking the user # ---- apperence ----
highlight: true # Controls syntax highlighting highlight: true # Controls syntax highlighting
light_theme: false # Activates a light color theme when true. ENV: AICHAT_LIGHT_THEME light_theme: false # Activates a light color theme when true. ENV: AICHAT_LIGHT_THEME
# Custom REPL prompt, see https://github.com/sigoden/aichat/wiki/Custom-REPL-Prompt for more detils
left_prompt:
'{color.green}{?session {?agent {agent}#}{session}{?role /}}{!session {?agent {agent}}}{role}{?rag @{rag}}{color.cyan}{?session )}{!session >}{color.reset} '
right_prompt:
'{color.purple}{?session {?consume_tokens {consume_tokens}({consume_percent}%)}{!consume_tokens {consume_tokens}}}{color.reset}'
# ---- behavior ----
save: true # Indicates whether to persist the message
wrap: no # Controls text wrapping (no, auto, <max-width>) wrap: no # Controls text wrapping (no, auto, <max-width>)
wrap_code: false # Enables or disables wrapping of code blocks wrap_code: false # Enables or disables wrapping of code blocks
keybindings: emacs # Choose keybinding style (emacs, vi) keybindings: emacs # Choose keybinding style (emacs, vi)
buffer_editor: null # Command used to edit the current input with Ctrl+O
# ---- prelude ----
prelude: null # Set a default role or session to start with (e.g. role:<name>, session:<name>) prelude: null # Set a default role or session to start with (e.g. role:<name>, session:<name>)
repl_prelude: null # This overrides 'prelude' when using REPL repl_prelude: null # Overrides the `prelude` setting specifically for conversations started in REPL
agent_prelude: null # Set a session to use when starting a agent. (e.g. temp, default)
# Command that will be used to edit the current line buffer with ctrl+o # ---- session ----
# if unset fallback to $EDITOR and $VISUAL # Controls the persistence of the session, if null, asking the user
buffer_editor: null save_session: null
# Compress session when token count reaches or exceeds this threshold (must be at least 1000)
compress_threshold: 4000
# Text prompt used for creating a concise summary of session message
summarize_prompt: 'Summarize the discussion briefly in 200 words or less to use as a prompt for future context.'
# Text prompt used for including the summary of the entire session
summary_prompt: 'This is a summary of the chat history as a recap: '
# ---- function-calling ----
# Controls the function calling feature. For setup instructions, visit https://github.com/sigoden/llm-functions # Controls the function calling feature. For setup instructions, visit https://github.com/sigoden/llm-functions
function_calling: false function_calling: false
# Regex for seletecting dangerous functions. # Regex for seletecting dangerous functions.
# User confirmation is required when executing these functions. # User confirmation is required when executing these functions.
# e.g. 'execute_command|execute_js_code' 'execute_.*' # e.g. 'execute_command|execute_js_code' 'execute_.*'
dangerously_functions_filter: null dangerously_functions_filter: null
agent_prelude: null # Set a session to use when starting a agent. (e.g. temp, default)
agents: agents:
- name: todo-sh - name: todo-sh
model: null model: null
@ -33,23 +48,15 @@ agents:
top_p: null top_p: null
dangerously_functions_filter: null dangerously_functions_filter: null
# Specifies the embedding model to use # ---- rag ----
rag_embedding_model: null rag_embedding_model: null # Specifies the embedding model to use
# Specifies the rerank model to use rag_rerank_model: null # Specifies the rerank model to use
rag_rerank_model: null rag_chunk_size: null # Specifies the chunk size
# Specifies the chunk size rag_chunk_overlap: null # Specifies the chunk overlap
rag_chunk_size: null rag_top_k: 4 # Specifies the number of documents to retrieve
# Specifies the chunk overlap rag_min_score_vector_search: 0 # Specifies the minimum relevance score for vector-based searching
rag_chunk_overlap: null rag_min_score_keyword_search: 0 # Specifies the minimum relevance score for keyword-based searching
# Specifies the number of documents to retrieve rag_min_score_rerank: 0 # Specifies the minimum relevance score for reranking
rag_top_k: 4
# Specifies the minimum relevance score for vector-based searching
rag_min_score_vector_search: 0
# Specifies the minimum relevance score for keyword-based searching
rag_min_score_keyword_search: 0
# Specifies the minimum relevance score for reranking
rag_min_score_rerank: 0
# Defines the query structure using variables like __CONTEXT__ and __INPUT__ to tailor searches to specific needs # Defines the query structure using variables like __CONTEXT__ and __INPUT__ to tailor searches to specific needs
rag_template: | rag_template: |
Use the following context as your learned knowledge, inside <context></context> XML tags. Use the following context as your learned knowledge, inside <context></context> XML tags.
@ -66,17 +73,7 @@ rag_template: |
Given the context information, answer the query. Given the context information, answer the query.
Query: __INPUT__ Query: __INPUT__
# Compress session when token count reaches or exceeds this threshold (must be at least 1000) # ---- clients ----
compress_threshold: 4000
# Text prompt used for creating a concise summary of session message
summarize_prompt: 'Summarize the discussion briefly in 200 words or less to use as a prompt for future context.'
# Text prompt used for including the summary of the entire 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 {?agent {agent}#}{session}{?role /}}{!session {?agent {agent}}}{role}{?rag @{rag}}{color.cyan}{?session )}{!session >}{color.reset} '
right_prompt: '{color.purple}{?session {?consume_tokens {consume_tokens}({consume_percent}%)}{!consume_tokens {consume_tokens}}}{color.reset}'
clients: clients:
# All clients have the following configuration: # All clients have the following configuration:
# - type: xxxx # - type: xxxx

@ -59,7 +59,7 @@ lazy_static! {
), ),
ReplCommand::new( ReplCommand::new(
".session", ".session",
"Begin a chat session", "Begin a session",
AssertState::False(StateFlags::SESSION_EMPTY | StateFlags::SESSION), AssertState::False(StateFlags::SESSION_EMPTY | StateFlags::SESSION),
), ),
ReplCommand::new( ReplCommand::new(
@ -69,12 +69,12 @@ lazy_static! {
), ),
ReplCommand::new( ReplCommand::new(
".save session", ".save session",
"Save the chat to file", "Save the current session to file",
AssertState::True(StateFlags::SESSION_EMPTY | StateFlags::SESSION) AssertState::True(StateFlags::SESSION_EMPTY | StateFlags::SESSION)
), ),
ReplCommand::new( ReplCommand::new(
".edit session", ".edit session",
"Edit the current session", "Edit the current session with an editor",
AssertState::True(StateFlags::SESSION_EMPTY | StateFlags::SESSION) AssertState::True(StateFlags::SESSION_EMPTY | StateFlags::SESSION)
), ),
ReplCommand::new( ReplCommand::new(

Loading…
Cancel
Save