-
Notifications
You must be signed in to change notification settings - Fork 703
Chat REPL Guide
sigoden edited this page Jan 19, 2025
·
19 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+oto 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}+enterto insert a newline directly.
- Press
-
History Search: Press
ctrl+rto 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.
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 role
.info role View role info
.edit role Edit current role
.save role Save current role to file
.exit role Exit active role

Compared to .role, .prompt does persist to a file; it creates and switches to a temporary role.

.session Start or switch to a session
.empty session Clear session messages
.compress session Compress session messages
.info session View session info
.edit session Edit current session
.save session Save current session to file
.exit session Exit active session

.agent Use an agent
.starter Use a conversation starter
.edit agent-config Edit agent configuration file
.info agent View agent info
.exit agent Leave agent

.rag Initialize or access RAG
.edit rag-docs Manage RAG documents
.rebuild rag Rebuild RAG for document changes
.sources rag View RAG sources for last query
.info rag View RAG info
.exit rag Leave RAG

.macro test-function-calling
.macro within-agent todo list all my todos

Usage: .file <file|dir|url|%%|cmd>... [-- <text>...]
.file data.txt
.file %% -- translate last reply to english
.file `git diff` -- generate git commit message
.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?
Note:
%%andcmdare supported starting from V0.27.0.
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 save_session true
.set compress_threshold 1000
.set rag_reranker_model <tab>
.set rag_top_k 4
.set highlight true
.edit config Edit configuration file
.edit role Edit current role
.edit session Edit current session
.edit agent-config Edit agent configuration file
.edit rag-docs Manage RAG documents

.info View system info
.info role View role info
.info session View session info
.info agent View agent info
.info rag View RAG info
.exit role Exit active role
.exit session Exit active session
.exit agent Leave agent
.exit rag Leave RAG
.exit Exit REPL