Skip to content

Commit f89b3ed

Browse files
m00nyONEyGuy
authored andcommitted
add config options and their documentation
1 parent 9d607f1 commit f89b3ed

File tree

4 files changed

+41
-10
lines changed

4 files changed

+41
-10
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "chatgpt-mattermost-bot.fullname" . }}-config
5+
labels:
6+
app: chatgpt-mattermost-bot
7+
{{- include "chatgpt-mattermost-bot.labels" . | nindent 4 }}
8+
data:
9+
MATTERMOST_URL: "{{ required "MATTERMOST_URL is required" .Values.config.MATTERMOST_URL }}"
10+
OPENAI_MODEL_NAME: "{{ .Values.config.OPENAI_MODEL_NAME | default "gpt-3.5-turbo" }}"
11+
OPENAI_MAX_TOKENS: "{{ .Values.config.OPENAI_MAX_TOKENS | default "2000" }}"
12+
OPENAI_TEMPERATURE: "{{ .Values.config.OPENAI_TEMPERATURE | default "1" }}"
13+
YFILES_SERVER_URL: "{{ .Values.config.YFILES_SERVER_URL | default "" }}"
14+
NODE_EXTRA_CA_CERTS: "{{ .Values.config.NODE_EXTRA_CA_CERTS | default "" }}"
15+
MATTERMOST_BOTNAME: "{{ .Values.config.MATTERMOST_BOTNAME | default "@chatgpt" }}"
16+
PLUGINS: "{{ .Values.config.PLUGINS | default "graph-plugin, image-plugin" }}"
17+
DEBUG_LEVEL: "{{ .Values.config.DEBUG_LEVEL | default "INFO" }}"
18+
BOT_CONTEXT_MSG: "{{ .Values.config.BOT_CONTEXT_MSG | default "100" }}"
19+
NODE_ENV: "{{ .Values.config.NODE_ENV | default "production" }}"
20+
21+

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ metadata:
55
labels:
66
app: chatgpt-mattermost-bot
77
{{- include "chatgpt-mattermost-bot.labels" . | nindent 4 }}
8-
data:
9-
MATTERMOST_TOKEN: {{ .Values.chatbot.mattermostToken | b64enc }}
10-
OPENAI_API_KEY: {{ .Values.chatbot.openaiApiKey | b64enc }}
8+
stringData:
9+
MATTERMOST_TOKEN: "{{ required "MATTERMOST_TOKEN is required" .Values.config.MATTERMOST_TOKEN }}"
10+
OPENAI_API_KEY: "{{ required "OPENAI_API_KEY is required" .Values.config.OPENAI_API_KEY }}"

helm/chatgpt-mattermost-bot/templates/deployment.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ spec:
3333
{{- toYaml .Values.securityContext | nindent 12 }}
3434
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3535
imagePullPolicy: {{ .Values.image.pullPolicy }}
36-
env:
37-
- name: MATTERMOST_URL
38-
value: {{ .Values.mattermost.clusterUrl }}:{{ .Values.mattermost.port }}
3936
envFrom:
37+
- configMapRef:
38+
name: {{ include "chatgpt-mattermost-bot.fullname" . }}-config
4039
- secretRef:
4140
name: {{ include "chatgpt-mattermost-bot.fullname" . }}-secret
4241
ports:

helm/chatgpt-mattermost-bot/values.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
mattermost:
2-
# <your-mattermost-service-name>.<namespace-where-service-is-deployed>.svc.cluster.local
3-
clusterUrl: http://mattermost-team-edition.mattermost.svc.cluster.local
4-
port: 8065
1+
config: # required: example: description:
2+
MATTERMOST_URL: "" # yes https://mattermost.server The URL to the server. This is used for connecting the bot to the Mattermost API
3+
MATTERMOST_TOKEN: "" # yes abababacdcdcd The authentication token from the logged in mattermost bot
4+
OPENAI_API_KEY: "" # yes sk-234234234234234234 The OpenAI API key to authenticate with OpenAI
5+
OPENAI_MODEL_NAME: "" # no gpt-3.5-turbo The OpenAI language model to use, defaults to gpt-3.5-turbo
6+
OPENAI_MAX_TOKENS: "" # no 2000 The maximum number of tokens to pass to the OpenAI API, defaults to 2000
7+
OPENAI_TEMPERATURE: "" # no 0.2 The sampling temperature to use, between 0 and 2, defaults to 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
8+
YFILES_SERVER_URL: "" # no http://localhost:3835 The URL to the yFiles graph service for embedding auto-generated diagrams.
9+
NODE_EXTRA_CA_CERTS: "" # no /file/to/cert.crt a link to a certificate file to pass to node.js for authenticating self-signed certificates
10+
MATTERMOST_BOTNAME: "" # no "@chatgpt" the name of the bot user in Mattermost, defaults to '@chatgpt'
11+
PLUGINS: "" # no graph-plugin, image-plugin The enabled plugins of the bot. By default, all plugins (grpah-plugin and image-plugin) are enabled.
12+
DEBUG_LEVEL: "" # no TRACE a debug level used for logging activity, defaults to INFO
13+
BOT_CONTEXT_MSG: "" # no 15 The number of previous messages which are appended to the conversation with ChatGPT, defaults to 100
14+
NODE_ENV: "" # no development The mode NodeJS runs in. Defaults to production
15+
516

617
replicaCount: 1
718

0 commit comments

Comments
 (0)