Updated Bing AI (markdown)

BobMaster 2023-06-05 12:31:47 +08:00
parent 36621e96bf
commit 84cad7dc32

@ -42,9 +42,8 @@ PASSWORD="xxxxxxxxxxxxxxx" # Optional
DEVICE_ID="xxxxxxxxxxxxxx" # required DEVICE_ID="xxxxxxxxxxxxxx" # 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, for !chat and !gpt command
BING_API_ENDPOINT="http://api:3000/conversation" # for !bing command API_ENDPOINT="http://api:3000/conversation" # for !bing command
ACCESS_TOKEN="xxxxxxxxxxxxxxxxxxxxx" # Optional, use user_id and password is recommended ACCESS_TOKEN="xxxxxxxxxxxxxxxxxxxxx" # Optional, use user_id and password is recommended
JAILBREAKENABLED="true" # Optional
``` ```
@ -57,8 +56,7 @@ sample `config.json`
"device_id": "xxxxxx", "device_id": "xxxxxx",
"room_id": "!FYCmBSkCRUxxxxxx:xxxxx.xxxx", "room_id": "!FYCmBSkCRUxxxxxx:xxxxx.xxxx",
"api_key": "xxxxxxxx", "api_key": "xxxxxxxx",
"bing_api_endpoint": "http://api:3000/conversation", "api_endpoint": "http://api:3000/conversation",
"jailbreakEnabled": true,
"access_token": "xxxxxxx" "access_token": "xxxxxxx"
} }
``` ```
@ -68,9 +66,9 @@ sample `settings.js` , replace `bingAiClient->userToken` with your credentials
export default { export default {
// Options for the Keyv cache, see https://www.npmjs.com/package/keyv. // Options for the Keyv cache, see https://www.npmjs.com/package/keyv.
// This is used for storing conversations, and supports additional drivers (conversations are stored in memory by default). // This is used for storing conversations, and supports additional drivers (conversations are stored in memory by default).
// Only applies when using `ChatGPTClient`. // Only necessary when using `ChatGPTClient`, or `BingAIClient` in jailbreak mode.
cacheOptions: {}, cacheOptions: {},
// If set, `ChatGPTClient` will use `keyv-file` to store conversations to this JSON file instead of in memory. // If set, `ChatGPTClient` and `BingAIClient` will use `keyv-file` to store conversations to this JSON file instead of in memory.
// However, `cacheOptions.store` will override this if set // However, `cacheOptions.store` will override this if set
storageFilePath: process.env.STORAGE_FILE_PATH || './cache.json', storageFilePath: process.env.STORAGE_FILE_PATH || './cache.json',
chatGptClient: { chatGptClient: {
@ -113,13 +111,20 @@ export default {
cookies: '', cookies: '',
// A proxy string like "http://<ip>:<port>" // A proxy string like "http://<ip>:<port>"
proxy: '', proxy: '',
// (Optional) Set 'x-forwarded-for' for the request. You can use a fixed IPv4 address or specify a range using CIDR notation,
// and the program will randomly select an address within that range. The 'x-forwarded-for' is not used by default now.
// xForwardedFor: '13.104.0.0/14',
// (Optional) Set 'genImage' to true to enable bing to create images for you. It's disabled by default.
// features: {
// genImage: true,
// },
// (Optional) Set to true to enable `console.debug()` logging // (Optional) Set to true to enable `console.debug()` logging
debug: true, debug: false,
}, },
chatGptBrowserClient: { chatGptBrowserClient: {
// (Optional) Support for a reverse proxy for the completions endpoint (private API server). // (Optional) Support for a reverse proxy for the conversation endpoint (private API server).
// Warning: This will expose your access token to a third party. Consider the risks before using this. // Warning: This will expose your access token to a third party. Consider the risks before using this.
reverseProxyUrl: 'https://chatgpt.duti.tech/api/conversation', reverseProxyUrl: 'https://bypass.churchless.tech/api/conversation',
// Access token from https://chat.openai.com/api/auth/session // Access token from https://chat.openai.com/api/auth/session
accessToken: '', accessToken: '',
// Cookies from chat.openai.com (likely not required if using reverse proxy server). // Cookies from chat.openai.com (likely not required if using reverse proxy server).
@ -136,27 +141,21 @@ export default {
// (Optional) Set to true to enable `console.debug()` logging // (Optional) Set to true to enable `console.debug()` logging
debug: false, debug: false,
// (Optional) Possible options: "chatgpt", "chatgpt-browser", "bing". (Default: "chatgpt") // (Optional) Possible options: "chatgpt", "chatgpt-browser", "bing". (Default: "chatgpt")
clientToUse: 'bing', // clientToUse: 'bing',
// (Optional) Generate titles for each conversation for clients that support it (only ChatGPTClient for now).
// This will be returned as a `title` property in the first response of the conversation.
generateTitles: false,
// (Optional) Set this to allow changing the client or client options in POST /conversation. // (Optional) Set this to allow changing the client or client options in POST /conversation.
// To disable, set to `null`. // To disable, set to `null`.
perMessageClientOptionsWhitelist: { perMessageClientOptionsWhitelist: {
// The ability to switch clients using `clientOptions.clientToUse` will be disabled if `validClientsToUse` is not set. // The ability to switch clients using `clientOptions.clientToUse` will be disabled if `validClientsToUse` is not set.
// To allow switching clients per message, you must set `validClientsToUse` to a non-empty array. // To allow switching clients per message, you must set `validClientsToUse` to a non-empty array.
validClientsToUse: ['bing', 'chatgpt', 'chatgpt-browser'], // values from possible `clientToUse` options above validClientsToUse: ['bing', 'chatgpt'], // values from possible `clientToUse` options above
// The Object key, e.g. "chatgpt", is a value from `validClientsToUse`. // The Object key, e.g. "chatgpt", is a value from `validClientsToUse`.
// If not set, ALL options will be ALLOWED to be changed. For example, `bing` is not defined in `perMessageClientOptionsWhitelist` above, // If not set, ALL options will be ALLOWED to be changed. For example, `bing` is not defined in `perMessageClientOptionsWhitelist` above,
// so all options for `bingAiClient` will be allowed to be changed. // so all options for `bingAiClient` will be allowed to be changed.
// If set, ONLY the options listed here will be allowed to be changed. // If set, ONLY the options listed here will be allowed to be changed.
// In this example, each array element is a string representing a property in `chatGptClient` above. // In this example, each array element is a string representing a property in `chatGptClient` above.
chatgpt: [
'promptPrefix',
'userLabel',
'chatGptLabel',
// Setting `modelOptions.temperature` here will allow changing ONLY the temperature.
// Other options like `modelOptions.model` will not be allowed to be changed.
// If you want to allow changing all `modelOptions`, define `modelOptions` here instead of `modelOptions.temperature`.
'modelOptions.temperature',
],
}, },
}, },
// Options for the CLI app // Options for the CLI app
@ -164,6 +163,6 @@ export default {
// (Optional) Possible options: "chatgpt", "bing". // (Optional) Possible options: "chatgpt", "bing".
// clientToUse: 'bing', // clientToUse: 'bing',
}, },
} };
``` ```