-
Notifications
You must be signed in to change notification settings - Fork 3
/
cha.sh
25 lines (20 loc) · 815 Bytes
/
cha.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#########################[CHA_CONFIGS]#########################
# get OpenAI API key: https://platform.openai.com/api-keys
export OPENAI_API_KEY=""
# (optional) get GROQ API key: https://console.groq.com/keys
export GROQ_API_KEY=""
# cha's github repo: https://github.com/MehmetMHY/cha
# run Cha in interactive mode (chat interface) without arguments or in non-interactive mode (processing one or multiple string arguments) if an argument is provided
chatgpt() {
# set a default OpenAI model
# - model list: https://platform.openai.com/docs/models
DEFAULT_MODEL="gpt-4o"
if [[ "$1" == "-f" && -n "$2" ]]; then
cha -m $DEFAULT_MODEL -f "$2"
elif [ $# -eq 0 ]; then
cha --model $DEFAULT_MODEL
else
cha -m $DEFAULT_MODEL -s "$*"
fi
}
#########################[CHA_CONFIGS]#########################