-
Notifications
You must be signed in to change notification settings - Fork 299
Chat REPL Guide
sigoden edited this page Oct 24, 2024
·
12 revisions
The core of AIChat is Chat-REPL.
-
Tab Autocompletion: All REPL commands have completions.
-
.<tab>
to complete REPL commands. -
.model< tab>
to complete chat models. -
.set <tab>
to complete config keys. -
.set key <tab>
to complete config values.
-
-
Multi-line Support: Input multi-line text in the following ways:
- Press
ctrl+o
to edit buffer with an external editor (recommend). - Paste multi-line text (requires terminal support for bracketed paste).
- Type
:::
to start multi-line editing, type:::
to finish it. - Use hotkey
{ctrl,shift,alt}+enter
to insert a newline directly.
- Press
-
History Search: Press
ctrl+r
to search the history. Useββ
to to navigate through the history. - Configurable Keybinding: Emacs-style bindings and basic VI-style.
- Custom REPL Prompt: Display information about the current context in the prompt.
.help Show this help message
.info View system info
.model Change the current LLM
.prompt Create a temporary role using a prompt
.role Create or switch to a specific role
.info role View role info
.edit role Edit the current role
.save role Save the current role to file
.exit role Leave the role
.session Begin a session
.empty session Erase messages in the current session
.compress session Compress messages in the current session
.info session View session info
.edit session Edit the current session
.save session Save the current session to file
.exit session End the session
.rag Init or use the RAG
.rebuild rag Rebuild the RAG to sync document changes
.sources rag View the RAG sources in the last query
.info rag View RAG info
.exit rag Leave the RAG
.agent Use a agent
.starter Use the conversation starter
.variable Set agent variable
.save agent-config Save the current agent config to file
.info agent View agent info
.exit agent Leave the agent
.file Include files with the message
.continue Continue the response
.regenerate Regenerate the last response
.copy Copy the last response
.set Adjust runtime configuration
.delete Delete roles/sessions/RAGs/agents
.exit Exit the REPL
Type ::: to start multi-line editing, type ::: to finish it.
Press Ctrl+O to open an editor for editing the input buffer.
Press Ctrl+C to cancel the response, Ctrl+D to exit the REPL.
openai:gpt-4o 128000 / 4096 | 5 / 15 π β
| | | | | | ββ support function callings
| | | | | ββ support visiion
| | | | ββ output price ($/1M)
| | | ββ input price ($/1M)
| | |
| | ββ max output tokens
| ββ max input tokens
ββ model id
.role Create or switch to a specific role
.info role View role info
.edit role Edit the current role
.save role Save the current role to file
.exit role Leave the role
Compared to .role
, .prompt
does persist to a file; it creates and switches to a temporary role.
.session Begin a session
.empty session Erase messages in the current session
.compress session Compress messages in the current session
.info session View session info
.edit session Edit the current session
.save session Save the current session to file
.exit session End the session
.rag Init or use the RAG
.rebuild rag Rebuild the RAG to sync document changes
.sources rag View the RAG sources in the last query
.info rag View RAG info
.exit rag Leave the RAG
.agent Use a agent
.starter Use the conversation starter
.variable Set agent variable
.save agent-config Save the current agent config to file
.info agent View agent info
.exit agent Leave the agent
Usage: .file <file>... [-- text...]
.file data.txt
.file config.yaml -- convert to toml
.file screentshot.png -- design a web app based on the image
.file https://ibb.co/a.png https://ibb.co/b.png -- what is the difference?
.file https://github.com/sigoden/aichat/blob/main/README.md -- what is the features of AIchat?
This command is often used to resume generation that was interrupted due to the response exceeding the length limit.
If the response is interrupted or unsatisfactory, you can regenerate it with .regenerate
.
.set <tab>
.set max_output_tokens 4096
.set temperature 1.2
.set top_p 0.8
.set dry_run true
.set stream false
.set save true
.set function_calling true
.set use_tools <tab>
.set agent_prelude temp
.set save_session true
.set compress_threshold 1000
.set rag_reranker_model <tab>
.set rag_top_k 4
.set highlight true
-
.info
: View system info -
.info role
: View role info -
.info session
: View session info -
.info rag
: View RAG info -
.info agent
: View agent info
-
.exit
: Exit the program. -
.exit role
: Exit the role. -
.exit session
: Exit the session. -
.exit rag
: Exit the RAG. -
.exit agent
: Exit the agent.