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
Copy file name to clipboardExpand all lines: README.md
+27-21Lines changed: 27 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,24 +9,30 @@ You need
9
9
- the [OpenAI API key](https://platform.openai.com/account/api-keys)
10
10
- a [Docker](https://www.docker.com/) server for continuously running the service, alternatively for testing, Node.js is sufficient.
11
11
12
-
There's a guide about how to do the first two steps written by @InterestingSoup, [here](https://interestingsoup.com/create-a-chatgpt-bot-on-mattermost/) (lots of ads on that page, just block them, ignore them, or keep on reading and try without their screenshots!)
12
+
Andrew Zigler from Mattermost created a [YouTube Video](https://www.youtube.com/watch?v=Hx4Ex7YZZiA) that quickly guides you through the setup.
13
+
14
+
If you want to learn more about how this plugin came to live, [read the blog post at yWorks.com](https://www.yworks.com/blog/diagramming-with-chatgpt)!
15
+
13
16
14
17
## Options
15
18
16
-
These are the available options, you can set them as environment variables when running [the script](./src/botservice.js)
19
+
These are the available options, you can set them as environment variables when running [the script](./src/botservice.ts)
17
20
or when [running the docker image](#using-the-ready-made-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 |
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 maximum number of tokens to pass to the OpenAI API, defaults to 2000 |
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
+
| YFILES_SERVER_URL | no |`http://localhost:3835`| The URL to the yFiles graph service for embedding auto-generated diagrams. |
31
+
| 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 |
32
+
| MATTERMOST_BOTNAME | no |`"@chatgpt"`| the name of the bot user in Mattermost, defaults to '@chatgpt' |
33
+
| PLUGINS | no |`graph-plugin, image-plugin`| The enabled plugins of the bot. By default all plugins (grpah-plugin and image-plugin) are enabled. |
34
+
| DEBUG_LEVEL | no |`TRACE`| a debug level used for logging activity, defaults to `INFO`|
35
+
| BOT_CONTEXT_MSG | no |`15`| The number of previous messages which are appended to the conversation with ChatGPT, defaults to 100 |
30
36
31
37
> **Note**
32
38
> The `YFILES_SERVER_URL` is used for automatically converting text information created by the bot into diagrams.
@@ -39,7 +45,7 @@ or when [running the docker image](#using-the-ready-made-image) or when configur
39
45
Use the prebuilt image from [`ghcr.io/yguy/chatgpt-mattermost-bot`](https://ghcr.io/yguy/chatgpt-mattermost-bot)
40
46
41
47
```bash
42
-
docker run -d --restart unless-stopped \
48
+
docker runPlugin -d --restart unless-stopped \
43
49
-e MATTERMOST_URL=https://mattermost.server \
44
50
-e MATTERMOST_TOKEN=abababacdcdcd \
45
51
-e OPENAI_API_KEY=234234234234234234 \
@@ -55,18 +61,18 @@ First step is to clone this repo.
For testing, you could now just run`npm install` and `npm run start` or `node src/botservice.js` directly, but be sure to set the [environment variables](#options) or pass them to the node process, first!
64
+
For testing, you could now just runPlugin`npm install` and `npm runPlugin start` or `node src/botservice.js` directly, but be sure to set the [environment variables](#options) or pass them to the node process, first!
59
65
60
-
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:
66
+
For production use, in order to create a service on a docker container that will always provide the service without you having to runPlugin it on your own PC, you can do the following:
61
67
62
68
Build the docker image from the [Dockerfile](./Dockerfile):
63
69
```bash
64
70
docker build . -t yguy/chatgpt-mattermost-bot
65
71
```
66
72
67
-
Create and run a container from the image
73
+
Create and runPlugin a container from the image
68
74
```bash
69
-
docker run -d --restart unless-stopped \
75
+
docker runPlugin -d --restart unless-stopped \
70
76
-e MATTERMOST_URL=https://mattermost.server \
71
77
-e MATTERMOST_TOKEN=abababacdcdcd \
72
78
-e OPENAI_API_KEY=234234234234234234 \
@@ -81,7 +87,7 @@ will need to provide the CA's public root to the container for validation.
81
87
If the root certificate is located at `/absolutepath/to/certfile.crt`, then you
82
88
can mount that file into the container at a fixed position and specify the [node environment variable](https://nodejs.org/api/cli.html#node_extra_ca_certsfile) accordingly:
If you want to run docker compose (maybe even merge it with your mattermost docker stack), you can use this
111
+
If you want to runPlugin docker compose (maybe even merge it with your mattermost docker stack), you can use this
106
112
as a starting point: First adjust the environment variables in `docker-compose.yml`.
107
113
108
114
### Required Environment Variables
@@ -172,4 +178,4 @@ I will also accept helpful pull requests if you find an issue or have an idea fo
172
178
173
179
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)!
174
180
175
-
This is under MIT license Copyright (c) 2023 Sebastian Mueller (yWorks)
181
+
This is under MIT license Copyright (c) 2023 Sebastian Mueller and Michael Haeglsperger (yWorks)
0 commit comments