-
Notifications
You must be signed in to change notification settings - Fork 321
Chat REPL Guide
sigoden edited this page Sep 18, 2024
·
14 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
.clear messages Erase 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
.set Adjust runtime configuration
.delete Delete roles/sessions/RAGs/agents
.copy Copy the last response
.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
Use the role:
> .role emoji
emoji> hello
π
View the role details:
emoji> .info emoji
name: emoji
prompt: 'I want you to translate the sentences I write into emojis. I will write the sentence, and you will express it with emojis. I just want you to express it with emojis. I don''t want you to reply with anything but emoji. The sentence to be translated: __INPUT__'
Leave the role:
emoji> .exit role
> hello
Hello there! How can I assist you today?
Use the role without switching to it (Can be used in session or agent context):
> .role emoji hello
π
>
Use the .prompt
feature to create a temporary role specifically for this purpose.
> .prompt your are a js console
%%> Date.now()
1658333431437
By default, AIChat behaves in a one-off request/response manner. With sessions, AIChat conducts context-aware conversations.
Seamlessly integrates document interactions into your chat experience.
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
.
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?
.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.