Skip to content

Commit

Permalink
fix and do some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
hibobmaster committed Sep 21, 2023
1 parent 02088f4 commit 8788e11
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HOMESERVER="https://matrix-client.matrix.org" # required
USER_ID="@lullap:xxxxxxxxxxxxx.xxx" # required
PASSWORD="xxxxxxxxxxxxxxx" # Optional if you use access token
PASSWORD="xxxxxxxxxxxxxxx" # required
DEVICE_ID="MatrixChatGPTBot" # required
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 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)

## Feature
Expand All @@ -23,7 +23,7 @@ Create two empty file, for persist database only<br>
touch sync_db manage_db
sudo docker compose up -d
```

manage_db(can be ignored) is for langchain agent, sync_db is for matrix sync database<br>
<hr>
Normal Method:<br>
system dependece: <code>libolm-dev</code>
Expand Down
3 changes: 2 additions & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ services:
# use env file or config.json
# - ./config.json:/app/config.json
# 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
- ./manage_db:/app/manage_db
# - ./manage_db:/app/manage_db
# import_keys path
# - ./element-keys.txt:/app/element-keys.txt
networks:
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def __init__(
self.base_path = Path(os.path.dirname(__file__)).parent

if lc_admin is not None:
lc_admin = list(filter(None, lc_admin.split(",")))
if isinstance(lc_admin, str):
lc_admin = list(filter(None, lc_admin.split(",")))
self.lc_admin = lc_admin
self.lc_cache = {}
if self.lc_admin is not None:
Expand Down

0 comments on commit 8788e11

Please sign in to comment.