-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqg
executable file
·42 lines (37 loc) · 1.18 KB
/
qg
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#
# qg
#
# script that uses chewie to implement a git-specific chat bot.
#
if [ "$CHEWIE_API" == "ollama" ]; then
QG_MODEL="codellama:7b-instruct"
elif [ "$CHEWIE_API" == "openai" ]; then
QG_MODEL="gpt-3.5-turbo"
elif [ "$CHEWIE_API" == "groq" ]; then
QG_MODEL="llama3-8b-8192"
else
QG_MODEL="codellama:7b-instruct"
CHEWIE_API="ollama"
fi
QG_CONTEXT_PATH=~/.cache/chewie
QG_CONTEXT=$QG_CONTEXT_PATH/qg-context.json
if [ "$1" == "-h" ] ; then
echo "Usage: qg [options]"
echo "Options:"
echo " -h Display this help message."
echo " -s Setup (or reset) qg."
exit 0
fi
if [ "$1" == "-s" ] ; then
echo "Setting up qg... "
echo "Using API \"$CHEWIE_API\""
echo "Using model \"$QG_MODEL\""
echo "Using context file \"$QG_CONTEXT\""
mkdir -p $QG_CONTEXT_PATH
chewie r u ctx="$QG_CONTEXT" > /dev/null
chewie u ctx="$QG_CONTEXT" mdl="$QG_MODEL" sys="You are an intelligent assistant helping me use git on Linux. All of your responses should be in the context of using git on Linux. If you do not know the answer to a question, just say \"I don\'t know\"." > /dev/null
echo "done!"
exit 0
fi
echo "$@" | chewie ctx="$QG_CONTEXT" mdl="$QG_MODEL"