text-gen-bot/README.md

35 lines
1.1 KiB
Markdown
Raw Normal View History

2022-08-15 00:50:58 -04:00
# text-gen-bot
2022-08-15 17:46:01 -04:00
Matrix bot that generates messages based off of messages of other users using a neural network.
2022-08-15 20:00:17 -04:00
## Usage
2022-08-15 22:35:18 -04:00
First install the needed [libraries](#setup). Then copy `example.config.json` and rename it `config.json`. Replace the items in angled brackets with their respective values of the bot account (e.g. replace `<DOMAIN.TLD>` with the homeserver url like `https://matrix.org` or `https://matrix.arrayinamatrix.xyz`). You can follow the instructions [here](https://matrix.org/docs/guides/usage-of-matrix-bot-sdk#instantiation) to obtain the token of an account.
2022-08-15 20:00:17 -04:00
Once the config file has been populated with valid data, execute the `index.js` file (Warning: executing for the first time will be slow.).
```sh
$ node index.js
...
2022-08-15 20:10:42 -04:00
<some warnings show up, ignore them>
2022-08-15 20:00:17 -04:00
...
Client has started!
2022-08-15 20:12:48 -04:00
...
2022-08-15 20:00:17 -04:00
```
## Setup
2022-08-15 17:46:01 -04:00
2022-08-15 19:03:20 -04:00
The project is split into 2 parts `index.js` and `textgen.py`. The `index.js` file contains the code that interacts with the user on Matrix and grabs text generated by the `textgen.py` file.
2022-08-15 17:46:01 -04:00
Install JavaSript SDK:
```sh
2022-08-15 19:03:20 -04:00
> pnpm add matrix-bot-sdk
2022-08-15 17:46:01 -04:00
```
Install Python module:
```sh
2022-08-15 19:03:20 -04:00
> pip3 install aitextgen
2022-08-15 17:46:01 -04:00
```