diff --git a/Start.bat b/Start.bat index bb8b25d0a..4cc857c49 100644 --- a/Start.bat +++ b/Start.bat @@ -1,2 +1,3 @@ call npm install -node server.js \ No newline at end of file +node server.js +pause \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8cfa1a6f5..bb3a10080 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "csrf-csrf": "^2.2.3", "exifreader": "^4.12.0", "express": "^4.18.2", + "gpt3-tokenizer": "^1.1.5", "ipaddr.js": "^2.0.1", "jimp": "^0.22.7", "json5": "^2.2.3", @@ -490,6 +491,11 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/array-keyed-map": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/array-keyed-map/-/array-keyed-map-2.1.3.tgz", + "integrity": "sha512-JIUwuFakO+jHjxyp4YgSiKXSZeC0U+R1jR94bXWBcVlFRBycqXlb+kH9JHxBGcxnVuSqx5bnn0Qz9xtSeKOjiA==" + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -1117,6 +1123,17 @@ "process": "^0.11.10" } }, + "node_modules/gpt3-tokenizer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/gpt3-tokenizer/-/gpt3-tokenizer-1.1.5.tgz", + "integrity": "sha512-O9iCL8MqGR0Oe9wTh0YftzIbysypNQmS5a5JG3cB3M4LMYjlAVvNnf8LUzVY9MrI7tj+YLY356uHtO2lLX2HpA==", + "dependencies": { + "array-keyed-map": "^2.1.3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", diff --git a/package.json b/package.json index 55066aef3..4f83820ae 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "csrf-csrf": "^2.2.3", "exifreader": "^4.12.0", "express": "^4.18.2", + "gpt3-tokenizer": "^1.1.5", "ipaddr.js": "^2.0.1", "jimp": "^0.22.7", "json5": "^2.2.3", diff --git a/poe-client.js b/poe-client.js index 01db60f1b..cb31323a6 100644 --- a/poe-client.js +++ b/poe-client.js @@ -29,9 +29,178 @@ const parent_path = path.resolve(__dirname); const queries_path = path.join(parent_path, "poe_graphql"); let queries = {}; +const cached_bots = {}; + const logger = console; -const user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0"; +const user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"; + +function extractFormKey(html) { + const scriptRegex = / + - Tavern.AI + SillyTavern +
-
@@ -62,657 +61,735 @@
-
+
-
+
-
-
+ +
+
+
-
-
-
-

Kobold Presets - - ? - -

- - -
-
-

- NovelAI Presets - - ? - -

- -
-
-
-

OpenAI Presets

- + + +
+
+

+ NovelAI Presets + + ? + +

+
-
-

OpenAI Model

- + + +
+
+

OpenAI Model

+ +
+
+
+

Text Gen WebUI (ooba) presets

+
+
+

Poe.com API Settings

+ +
-
-

Text generation web UI presets

- +
+
+
+
+ Response Length (tokens) +
+
+ +
+
+ select +
+
+
+
+ Context Size (tokens) +
+
+ +
+
+ select +
+
+
-
-

Poe.com API Settings

- +
+
+
+
+ Temperature +
+
+ +
+
+ select +
+
+
+
+ Rep. Pen. +
+
+ +
+
+ select +
+
+
+
+ Rep. Pen. Range +
+
+ +
+
+ select +
+
+
+
+
+
+
+
+ Temperature +
+
+ +
+
+ select +
+
+
+
+ Rep. Pen. +
+
+ +
+
+ select +
+
+
+
+ Encoder Rep. Pen. +
+
+ +
+
+ select +
+
+
+
+ No Repeat Ngram Size +
+
+ +
+
+ select +
+
+
+
+ Min Length +
+
+ +
+
+ select +
+
+
+
+
+
+ OpenAI Reverse Proxy +
+
+ Alternative server URL (leave empty to use the default value).
+ Don't expose your real API keys to reverse proxies! +
+
+ +
+
+
+
+ Context Size (tokens) +
+
+ +
+
+ select +
+
+
+
+ Max Response Length (tokens) +
+
+ +
+
+
+
+ Temperature +
-
-
-
-
-
-
- Amount generation +
+ +
+
+ select +
- select - -
-
-
- Context Size -
- select - -
-
-
-
-
-
-
- Temperature -
-
- select -
-
- -
-
-
-
- Repetition Penalty -
-
- select -
-
- -
-
-
-
- Repetition Penalty Range -
-
- select -
-
- -
-
-
-
-
-
-
-
- Temperature -
-
- select -
-
- -
-
-
-
- Repetition Penalty -
-
- select -
-
- -
-
-
-
- Encoder Repetition Penalty -
-
- select -
-
- -
-
-
-
- No Repeat Ngram Size -
-
- select -
-
- -
-
-
-
- Min Length -
-
- select -
-
- -
-
-
- -
-
- -
-
-
-
-
- OpenAI Reverse Proxy -
-
- Alternative server URL (leave empty to use the default value).
- Don't expose your real API keys to reverse proxies! -
-
- -
-
-
-
- OpenAI Context Size -
-
- select -
-
- -
-
+
+
+ Frequency Penalty +
-
-
- OpenAI max response length (in tokens) +
+ +
+
+ select +
-
- +
+
+ Presence Penalty +
+
+ +
+
+ select +
-
- -
-
- Temperature -
-
- select -
-
- -
-
- -
-
- Frequency Penalty -
-
- select -
-
- -
-
- -
-
- Presence Penalty -
-
- select -
-
- -
-
- -