You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| MATTERMOST_URL | yes |`https://mattermost.server`| The URL to the server. This is used for connecting the bot to the Mattermost API |
25
-
| MATTERMOST_TOKEN | yes |`abababacdcdcd`| The authentication token from the logged in mattermost bot |
26
-
| OPENAI_API_KEY | yes |`sk-234234234234234234`| The OpenAI API key to authenticate with OpenAI |
27
-
| OPENAI_MODEL_NAME | no |`gpt-3.5-turbo`| The OpenAI language model to use, defaults to `gpt-3.5-turbo`|
28
-
| OPENAI_MAX_TOKENS | no |`2000`| The max_tokens parameter to pass to the OpenAI API, with a default value of 2000. API will answer up to this number of tokens |
29
-
| 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. |
30
-
| AZURE_OPENAI_API_KEY | no |`0123456789abcdefghijklmno`| The Azure OpenAI Service API key to authoenticate |
31
-
| AZURE_OPENAI_API_INSTANCE_NAME | no |`example-name`| The instance name on the Azure OpenAI Service |
32
-
| AZURE_OPENAI_API_DEPLOYMENT_NAME | no |`gpt-35-turbo`| The name of the deployed model on the Azure OpenAI Service |
33
-
| AZURE_OPENAI_API_VERSION | no |`2023-03-15-preview`| The Azure OpenAI version |
34
-
| YFILES_SERVER_URL | no |`http://localhost:3835`| The URL to the yFiles graph service for embedding auto-generated diagrams. |
35
-
| 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 |
36
-
| MATTERMOST_BOTNAME | no |`"@chatgpt"`| the name of the bot user in Mattermost, defaults to '@chatgpt' |
37
-
| MAX_PROMPT_TOKENS | no |`2000`| Maximum token count of the prompt passed to the OpenAI API. default is 2000 |
38
-
| DEBUG_LEVEL | no |`TRACE`| a debug level used for logging activity, defaults to `INFO`|
22
+
These are the available options, you can set them as environment variables when running [the script](./src/botservice.ts)
23
+
or when [running the docker image](#using-the-ready-made-docker-image) or when configuring your [docker-compose](#docker-compose) file.
| MATTERMOST_URL | yes |`https://mattermost.server`| The URL to the server. This is used for connecting the bot to the Mattermost API |
28
+
| MATTERMOST_TOKEN | yes |`abababacdcdcd`| The authentication token from the logged in mattermost bot |
29
+
| OPENAI_API_KEY | yes |`sk-234234234234234234`| The OpenAI API key to authenticate with OpenAI |
30
+
| OPENAI_MODEL_NAME | no |`gpt-3.5-turbo`| The OpenAI language model to use, defaults to `gpt-3.5-turbo`|
31
+
| OPENAI_MAX_TOKENS | no |`2000`| The maximum number of tokens to pass to the OpenAI API, defaults to 2000 |
32
+
| 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. |
33
+
| YFILES_SERVER_URL | no |`http://localhost:3835`| The URL to the yFiles graph service for embedding auto-generated diagrams. |
34
+
| 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 |
35
+
| MATTERMOST_BOTNAME | no |`"@chatgpt"`| the name of the bot user in Mattermost, defaults to '@chatgpt' |
36
+
| PLUGINS | no |`graph-plugin, image-plugin`| The enabled plugins of the bot. By default all plugins (grpah-plugin and image-plugin) are enabled. |
37
+
| DEBUG_LEVEL | no |`TRACE`| a debug level used for logging activity, defaults to `INFO`|
38
+
| BOT_CONTEXT_MSG | no |`15`| The number of previous messages which are appended to the conversation with ChatGPT, defaults to 100 |
39
39
40
40
> **Note**
41
41
> The `YFILES_SERVER_URL` is used for automatically converting text information created by the bot into diagrams.
42
42
> This is currently in development. You can see it in action, here:
Use the prebuilt image from [`gitlab.on-o.com/docker/chatgpt-mattermost-bot/release`](https://gitlab.on-o.com/Docker/chatgpt-mattermost-bot/container_registry/150)
60
49
@@ -67,29 +56,17 @@ docker run -d --restart unless-stopped \
For testing, you could now just run `npm ci` and `npm run start`or `npx ts-node src/botservice.ts`directly, but be sure to set the [environment variables](#options) or pass them to the node process, first!
67
+
For testing, you could now just run `npm install` and `npm run start` directly, but be sure to set the [environment variables](#options)or pass them to the node process, first!
91
68
92
-
For production use, in order to create a service on a docker container that will always provide the service without you having to run it on your own PC, you can do the following:
69
+
For production use, in order to create a service on a docker container that will always provide the service without you having to run it on your own machine, you can do the following:
93
70
94
71
Build the docker image from the [Dockerfile](./Dockerfile):
95
72
```bash
@@ -171,15 +148,8 @@ services:
171
148
NODE_EXTRA_CA_CERTS: /certs/certfile.crt
172
149
```
173
150
174
-
### Run the container as a daemon
175
-
When all configuration is complete, build and start the container service.
176
-
177
-
Build docker image:
178
-
```bash
179
-
docker compose build
180
-
```
181
-
182
-
Start container:
151
+
### Run the container as a service
152
+
When all configuration is complete, start the container service.
183
153
```bash
184
154
docker compose up -d
185
155
```
@@ -205,10 +175,10 @@ Here's an example chat that I just had with our bot:
205
175
>chatgpt (BOT):
206
176
>>Hello there! I'm @chatgpt, a friendly and reliable Mattermost bot designed to make your communication experience smoother and more efficient. I'm honored to be part of the team at yWorks, where I help employees get things done faster and with less hassle. With my advanced machine learning algorithms, I'm capable of understanding complex natural language queries and providing succinct and accurate responses in a matter of seconds. Whether you're a developer looking for information on your codebase or a manager seeking to streamline your team's workflows, I'm here to help. Installing a Mattermost chatbot like me is a must for any organization looking to boost its productivity and enjoy a more pleasant communication experience. So what are you waiting for? Let's chat!
207
177
208
-
I built this tool as a quick hack on a rainy Saturday afternoon, but we are using the bot in production in our Mattermost instance at our office at [yworks](https://www.yworks.com) and the bot has proved to be very helpful for many simple tasks. Give it a try and provide feedback if you like! It's really not very expensive: We had it runnning for about 30 users for two weeks and that cost us less than half a dollar for the ChatGPT service!
178
+
I built this tool as a quick hack on a rainy Saturday afternoon, but we are using the bot in production in our Mattermost instance at our office at [yworks](https://www.yworks.com) and the bot has proved to be very helpful for many simple tasks. Give it a try and provide feedback if you like! It's really not very expensive: We had it running for about 30 users for two weeks and that cost us less than half a dollar for the ChatGPT service!
209
179
210
180
I will also accept helpful pull requests if you find an issue or have an idea for an improvement.
211
181
212
182
Last but not least, check out [yWorks](https://www.yworks.com)' fine diagramming SDKs for software developers [yFiles](https://yworks.com/yfiles) and our [free online graph and diagram editors](https://yworks.com/editors)!
213
183
214
-
This is under MIT license Copyright (c) 2023 Sebastian Mueller (yWorks)
184
+
This is under MIT license Copyright (c) 2023 Sebastian Mueller (yWorks) and Michael Haeglsperger (yWorks)
0 commit comments