-
Notifications
You must be signed in to change notification settings - Fork 357
Chat REPL Guide
The core of AIChat is Chat-REPL.
-
Tab Autocompletion: All REPL commands have tab completions.
Type
.<tab>
to complete REPL commands. Type.set <tab>
to complete config keys. Type.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. -
History Search: Press
ctrl+r
to search the history.The history only includes text entered after the REPL starts.
-
Configurable Keybinding: Emacs-style bindings and basic VI-style
The default keybindings are Emacs. Switch to VI keybindings by adding
keybindings: vi
to theconfig.yaml
file. - 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 Switch to a specific role
.info role View role info
.exit role Leave the role
.session Begin a session
.info session View session info
.save session Save the current session to file
.edit session Edit the current session with an editor
.clear messages Erase messages in the current session
.exit session End the session
.rag Init or use a rag
.info rag View rag info
.exit rag Leave the rag
.agent Use a agent
.info agent View agent info
.starter Use the conversation starter
.exit agent Leave the agent
.file Include files with the message
.continue Continue the response
.regenerate Regenerate the last response
.set Adjust settings
.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
π
>
There are situations where setting a system message is necessary, but modifying the roles.yaml
file is not ideal.
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?
.set <tab>
.set max_output_tokens 4096
.set temperature 1.2
.set top_p 0.8
.set rag_rerank_model <tab>
.set rag_top_k 4
.set function_calling true
.set compress_threshold 1000
.set save true
.set save_session true
.set highlight true
.set dry_run true
-
.info
: View system information -
.info role
: view your current role information. -
.info session
: view your current session information. -
.info rag
: view your current RAG information. -
.info agent
: view your current agent information.
-
.exit
: Exit the program. -
.exit role
: Exit the role. -
.exit session
: Exit the session. -
.exit rag
: Exit the RAG. -
.exit agent
: Exit the agent.