From 276d0fe40bbb38fbb22e213b3069c859e1426533 Mon Sep 17 00:00:00 2001 From: hibobmaster Date: Tue, 11 Apr 2023 10:54:59 +0800 Subject: [PATCH] improve config sample --- .env.example | 4 ++-- config.json.sample | 7 +++++-- main.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 0e0f843..9776077 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,9 @@ # Please remove the option that is blank HOMESERVER="https://matrix.xxxxxx.xxxx" # required USER_ID="@lullap:xxxxxxxxxxxxx.xxx" # required -PASSWORD="xxxxxxxxxxxxxxx" # required +PASSWORD="xxxxxxxxxxxxxxx" # Optional DEVICE_ID="xxxxxxxxxxxxxx" # required -ROOM_ID="!FYCmBSkCRUXXXXXXXXX:matrix.XXX.XXX" # Optional, if the property is blank, bot will work on the room it is in (Unencrypted room only as for now) +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 BING_API_ENDPOINT="xxxxxxxxxxxxxxx" # Optional, for !bing command ACCESS_TOKEN="xxxxxxxxxxxxxxxxxxxxx" # Optional, use user_id and password is recommended diff --git a/config.json.sample b/config.json.sample index 04ea8fb..e06b502 100644 --- a/config.json.sample +++ b/config.json.sample @@ -5,5 +5,8 @@ "device_id": "ECYEOKVPLG", "room_id": "!FYCmBSkCRUNvZDBaDQ:matrix.qqs.tw", "api_key": "xxxxxxxxxxxxxxxxxxxxxxxx", - "access_token": "xxxxxxx" -} \ No newline at end of file + "bing_api_endpoint": "http://api:3000/conversation", + "jailbreakEnabled": true, + "access_token": "xxxxxxx", + "bing_auth_cookie": "xxxxxxxxxxx" +} diff --git a/main.py b/main.py index 0184324..101bd52 100644 --- a/main.py +++ b/main.py @@ -33,7 +33,7 @@ async def main(): api_key=os.environ.get("OPENAI_API_KEY"), bing_api_endpoint=os.environ.get("BING_API_ENDPOINT"), access_token=os.environ.get("ACCESS_TOKEN"), - jailbreakEnabled=os.environ.get("JAILBREAKENABLED"), + jailbreakEnabled=os.environ.get("JAILBREAKENABLED", "false").lower() in ('true', '1', 't'), bing_auth_cookie=os.environ.get("BING_AUTH_COOKIE"), )