File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
helm/chatgpt-mattermost-bot Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 17
17
DEBUG_LEVEL : " {{ .Values.config.DEBUG_LEVEL | default " INFO" }}"
18
18
BOT_CONTEXT_MSG : " {{ .Values.config.BOT_CONTEXT_MSG | default " 100" }}"
19
19
NODE_ENV : " {{ .Values.config.NODE_ENV | default " production" }}"
20
-
21
-
20
+ BOT_INSTRUCTION : " {{ .Values.config.BOT_INSTRUCTION | default " " }}"
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ config: # required: example: descriptio
26
26
DEBUG_LEVEL : " " # no TRACE a debug level used for logging activity, defaults to INFO
27
27
BOT_CONTEXT_MSG : " " # no 15 The number of previous messages which are appended to the conversation with ChatGPT, defaults to 100
28
28
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?
29
30
30
31
31
32
serviceAccount :
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ if (!global.FormData) {
20
20
21
21
const name = process . env [ 'MATTERMOST_BOTNAME' ] || '@chatgpt'
22
22
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."
23
26
24
27
/* List of all registered plugins */
25
28
const plugins : PluginBase < any > [ ] = [
@@ -30,9 +33,8 @@ const plugins: PluginBase<any>[] = [
30
33
]
31
34
32
35
/* 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 } )
36
38
37
39
async function onClientMessage ( msg : WebSocketMessage < JSONMessageData > , meId : string ) {
38
40
if ( msg . event !== 'posted' || ! meId ) {
You can’t perform that action at this time.
0 commit comments