Skip to content

Commit 1a9644b

Browse files
committed
Merge remote-tracking branch 'm00nyONE/master'
2 parents fd893b9 + 9382818 commit 1a9644b

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ or when [running the docker image](#using-the-ready-made-docker-image) or when c
3737
| PLUGINS | no | `graph-plugin, image-plugin` | The enabled plugins of the bot. By default all plugins (grpah-plugin and image-plugin) are enabled. |
3838
| DEBUG_LEVEL | no | `TRACE` | a debug level used for logging activity, defaults to `INFO` |
3939
| BOT_CONTEXT_MSG | no | `15` | The number of previous messages which are appended to the conversation with ChatGPT, defaults to 100 |
40+
| BOT_INSTRUCTION | no | `Act like Elon Musk` | Extra instruction to give your assistance. How should the assistant behave? |
4041

4142
> **Note**
4243
> The `YFILES_SERVER_URL` is used for automatically converting text information created by the bot into diagrams.

helm/chatgpt-mattermost-bot/templates/chatbot-config.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ data:
1717
DEBUG_LEVEL: "{{ .Values.config.DEBUG_LEVEL | default "INFO" }}"
1818
BOT_CONTEXT_MSG: "{{ .Values.config.BOT_CONTEXT_MSG | default "100" }}"
1919
NODE_ENV: "{{ .Values.config.NODE_ENV | default "production" }}"
20-
21-
20+
BOT_INSTRUCTION: "{{ .Values.config.BOT_INSTRUCTION | default "" }}"

helm/chatgpt-mattermost-bot/values.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ image:
33
repository: chatgpt-mattermost-bot
44
pullPolicy: IfNotPresent
55
# Overrides the image tag whose default is the chart appVersion.
6-
tag: "v2.1.2"
6+
tag: ""
77

88
imagePullSecrets: []
99

@@ -26,6 +26,7 @@ config: # required: example: descriptio
2626
DEBUG_LEVEL: "" # no TRACE a debug level used for logging activity, defaults to INFO
2727
BOT_CONTEXT_MSG: "" # no 15 The number of previous messages which are appended to the conversation with ChatGPT, defaults to 100
2828
NODE_ENV: "" # no development The mode NodeJS runs in. Defaults to production
29+
BOT_INSTRUCTION: "" # no Act like Elon Musk Extra instruction to give your assistance. How should the assistant behave?
2930

3031

3132
serviceAccount:

src/botservice.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ if (!global.FormData) {
2020

2121
const name = process.env['MATTERMOST_BOTNAME'] || '@chatgpt'
2222
const contextMsgCount = Number(process.env['BOT_CONTEXT_MSG'] ?? 100)
23+
const additionalBotInstructions = process.env['BOT_INSTRUCTION'] || "You are a helpful assistant. Whenever users asks you for help you will " +
24+
"provide them with succinct answers formatted using Markdown. You know the user's name as it is provided within the " +
25+
"meta data of the messages."
2326

2427
/* List of all registered plugins */
2528
const plugins: PluginBase<any>[] = [
@@ -30,9 +33,8 @@ const plugins: PluginBase<any>[] = [
3033
]
3134

3235
/* The main system instruction for GPT */
33-
const botInstructions = "Your name is " + name + " and you are a helpful assistant. Whenever users asks you for help you will " +
34-
"provide them with succinct answers formatted using Markdown. You know the user's name as it is provided within the " +
35-
"meta data of the messages."
36+
const botInstructions = "Your name is " + name + ". " + additionalBotInstructions
37+
botLog.debug({botInstructions: botInstructions})
3638

3739
async function onClientMessage(msg: WebSocketMessage<JSONMessageData>, meId: string) {
3840
if (msg.event !== 'posted' || !meId) {

0 commit comments

Comments
 (0)