fix and do some improvements
This commit is contained in:
parent
02088f445d
commit
8788e11373
6 changed files with 8 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
HOMESERVER="https://matrix-client.matrix.org" # required
|
HOMESERVER="https://matrix-client.matrix.org" # required
|
||||||
USER_ID="@lullap:xxxxxxxxxxxxx.xxx" # required
|
USER_ID="@lullap:xxxxxxxxxxxxx.xxx" # required
|
||||||
PASSWORD="xxxxxxxxxxxxxxx" # Optional if you use access token
|
PASSWORD="xxxxxxxxxxxxxxx" # required
|
||||||
DEVICE_ID="MatrixChatGPTBot" # required
|
DEVICE_ID="MatrixChatGPTBot" # required
|
||||||
ROOM_ID="!FYCmBSkCRUXXXXXXXXX:matrix.XXX.XXX" # Optional, if not set, bot will work on the room it is in
|
ROOM_ID="!FYCmBSkCRUXXXXXXXXX:matrix.XXX.XXX" # Optional, if not set, bot will work on the room it is in
|
||||||
OPENAI_API_KEY="xxxxxxxxxxxxxxxxx" # Optional, for !chat and !gpt command
|
OPENAI_API_KEY="xxxxxxxxxxxxxxxxx" # Optional
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
This is a simple Matrix bot that support using OpenAI API, Langchain to generate responses from user inputs. The bot responds to these commands: `!gpt`, `!chat` and `!pic` and `!new` and `!lc` and `!help` depending on the first word of the prompt.
|
This is a simple Matrix bot that support using OpenAI API, Langchain to generate responses from user inputs. The bot responds to these commands: `!gpt`, `!chat`, `!pic`, `!new`, `!lc` and `!help` depending on the first word of the prompt.
|
||||||
![ChatGPT](https://i.imgur.com/kK4rnPf.jpeg)
|
![ChatGPT](https://i.imgur.com/kK4rnPf.jpeg)
|
||||||
|
|
||||||
## Feature
|
## Feature
|
||||||
|
@ -23,7 +23,7 @@ Create two empty file, for persist database only<br>
|
||||||
touch sync_db manage_db
|
touch sync_db manage_db
|
||||||
sudo docker compose up -d
|
sudo docker compose up -d
|
||||||
```
|
```
|
||||||
|
manage_db(can be ignored) is for langchain agent, sync_db is for matrix sync database<br>
|
||||||
<hr>
|
<hr>
|
||||||
Normal Method:<br>
|
Normal Method:<br>
|
||||||
system dependece: <code>libolm-dev</code>
|
system dependece: <code>libolm-dev</code>
|
||||||
|
|
|
@ -12,8 +12,9 @@ services:
|
||||||
# use env file or config.json
|
# use env file or config.json
|
||||||
# - ./config.json:/app/config.json
|
# - ./config.json:/app/config.json
|
||||||
# use touch to create empty db file, for persist database only
|
# use touch to create empty db file, for persist database only
|
||||||
|
# manage_db(can be ignored) is for langchain agent, sync_db is for matrix sync database
|
||||||
- ./sync_db:/app/sync_db
|
- ./sync_db:/app/sync_db
|
||||||
- ./manage_db:/app/manage_db
|
# - ./manage_db:/app/manage_db
|
||||||
# import_keys path
|
# import_keys path
|
||||||
# - ./element-keys.txt:/app/element-keys.txt
|
# - ./element-keys.txt:/app/element-keys.txt
|
||||||
networks:
|
networks:
|
||||||
|
|
|
@ -117,6 +117,7 @@ class Bot:
|
||||||
self.base_path = Path(os.path.dirname(__file__)).parent
|
self.base_path = Path(os.path.dirname(__file__)).parent
|
||||||
|
|
||||||
if lc_admin is not None:
|
if lc_admin is not None:
|
||||||
|
if isinstance(lc_admin, str):
|
||||||
lc_admin = list(filter(None, lc_admin.split(",")))
|
lc_admin = list(filter(None, lc_admin.split(",")))
|
||||||
self.lc_admin = lc_admin
|
self.lc_admin = lc_admin
|
||||||
self.lc_cache = {}
|
self.lc_cache = {}
|
||||||
|
|
Loading…
Reference in a new issue