234 Commits

Author SHA1 Message Date
valadaptive
0f25d51a53 Send Kobold sampler order as an array 2023-12-14 02:03:36 -05:00
Cohee
796659f68c Add proper fetch import 2023-12-14 01:39:34 +02:00
Cohee
0cd92f13b4 Merge branch 'staging' into separate-kobold-endpoints 2023-12-14 01:33:36 +02:00
Cohee
cebd6e9e0f Add API token ids from KoboldCpp 2023-12-14 01:28:18 +02:00
Cohee
0d0dd5e170 Revert old comment 2023-12-13 02:50:50 +02:00
Cohee
52de5869fe Rename file, add missing fetch 2023-12-13 02:22:35 +02:00
valadaptive
2c159ff93f Move Kobold API endpoints to their own module 2023-12-12 16:42:12 -05:00
valadaptive
35c2f8bf66 Move text completions API endpoints to own module 2023-12-12 16:41:16 -05:00
Cohee
2ca9015a5f Add filters to serpapi/visit 2023-12-12 03:56:36 +02:00
Cohee
299749a4e7 Add prerequisites for websearch extension 2023-12-12 01:08:47 +02:00
Cohee
dbd52a7994
Merge pull request #1482 from valadaptive/sse-stream
Refactor server-sent events parsing
2023-12-10 18:32:19 +02:00
Cohee
b107ace719 Avoid sending 401 in forwarded responses.
Status code 401 resets the client Basic auth, so we replace it with 400. This can produce an interesting artifact as "400 Unauthorized", but it's not out of spec.

"The reason phrases listed here are only recommendations -- they can be replaced by local equivalents or left out altogether without affecting the protocol."

https://www.rfc-editor.org/rfc/rfc9110.html#name-overview-of-status-codes
2023-12-10 18:00:04 +02:00
valadaptive
30502ac949 Split up Kobold and textgenerationwebui endpoints
The endpoint was one big if/else statement that did two entirely
different things depending on the value of main_api. It makes more sense
for those to be two separate endpoints.
2023-12-09 20:26:24 -05:00
valadaptive
04e92efe29 Move API tokenization endpoint into /tokenizers
Requires extracting some more functions out of server.js.
2023-12-09 19:35:49 -05:00
Cohee
44ac2ca4e6 Avoid returning 401 as API response code 2023-12-09 15:11:35 +02:00
valadaptive
055d6c4337 Properly forward status codes from streams 2023-12-07 18:06:17 -05:00
valadaptive
c0a7472fe9 Move background file instead of copying+deleting 2023-12-07 15:28:04 -05:00
valadaptive
e7dce9b107 Remove response_dw_bg 2023-12-07 15:24:05 -05:00
valadaptive
32c86c1e95 Move backgrounds endpoints into separate file 2023-12-07 15:24:05 -05:00
valadaptive
eb1d4aed4d Move stats helpers into stats endpoint 2023-12-07 13:04:54 -05:00
valadaptive
afe0dfe913 Move stats endpoints into separate file 2023-12-07 13:00:34 -05:00
valadaptive
bf2b59279b Move worldinfo endpoints into separate file 2023-12-06 20:00:51 -05:00
valadaptive
cf2b074d4b Move group endpoints into separate file 2023-12-06 20:00:31 -05:00
valadaptive
e870c35613 Move chat endpoints into separate file 2023-12-06 19:59:32 -05:00
valadaptive
9c850b0b0c Fix double file extension on uploaded images 2023-12-06 17:29:10 -05:00
valadaptive
66da13b1bb Use withFileTypes instead of stat'ing each file 2023-12-06 17:22:37 -05:00
valadaptive
5096e70c11 Move client-relative path logic to helper function 2023-12-06 17:22:37 -05:00
valadaptive
39d771cc4a Replace path "\" with "/" server-side 2023-12-06 17:22:37 -05:00
valadaptive
795ca2247b Return filename validation messages 2023-12-06 17:22:37 -05:00
valadaptive
41d427f4a8 Move sanitize call inside validation function
Also rename it (again) to validateAssetFileName.
2023-12-06 16:46:52 -05:00
Cohee
100dae5fd0
Merge pull request #1444 from valadaptive/characters-endpoint
Move character endpoints into their own module
2023-12-06 23:45:14 +02:00
Cohee
d0a35deeec Fix OpenAI presets extension 2023-12-06 21:46:08 +02:00
Cohee
60909cef1f Fix server crash on import. Fix possible undefined warning 2023-12-06 01:02:48 +02:00
valadaptive
4faa20bb1f Remove "upload" endpoint from assets API
I accidentally reintroduced this when splitting up the commits, I think
2023-12-05 15:02:30 -05:00
valadaptive
c00df4f45b Clean up file name sanitization
- Checking for null bytes is unnecessary because the check for illegal
characters directly below it will catch them.
- We can use the path.extname method to get the file extension more
cleanly. It returns the *last* extension (e.g.
path.extname('file.foo.js') === '.js'), so behavior is preserved.
- Normalizing the path is unnecessary. We don't allow any path
separators in the file name, so it does nothing.
- Stripping '..', path separators, and '$' is unnecessary because of the
earlier illegal character check.
2023-12-05 09:25:45 -05:00
valadaptive
a457484c2d Move character endpoints into their own module 2023-12-04 17:35:06 -05:00
Cohee
1ade0fda11 Merge branch 'staging' into stable-diffusion-router 2023-12-05 00:25:24 +02:00
Cohee
b287d5f3bd Merge branch 'staging' into tokenizers-router 2023-12-05 00:19:44 +02:00
Cohee
21e19674b4 Merge branch 'staging' into vectors-router 2023-12-05 00:15:36 +02:00
Cohee
444f67e930 Merge branch 'staging' into translate-router 2023-12-05 00:11:06 +02:00
Cohee
eb273ced59 Merge branch 'staging' into thumbnails-router 2023-12-05 00:08:15 +02:00
Cohee
9d0a0bc139 Merge branch 'staging' into sprites-router 2023-12-05 00:01:03 +02:00
Cohee
2acb7d1ae5 Merge branch 'staging' into serpapi-router 2023-12-04 23:57:23 +02:00
Cohee
1eb6f33e8b Merge branch 'staging' into secrets-router 2023-12-04 23:54:54 +02:00
Cohee
6fc0e485cd Merge branch 'staging' into presets-router 2023-12-04 23:51:08 +02:00
Cohee
32c3c34e4b Merge branch 'staging' into openai-router 2023-12-04 23:45:50 +02:00
Cohee
dca470c9e9 Merge branch 'staging' into novelai-router 2023-12-04 22:14:46 +02:00
Cohee
6fd6d4fc4d Merge branch 'staging' into horde-router 2023-12-04 22:07:39 +02:00
Cohee
aff821aa07 Fix discovery endpoint route 2023-12-04 21:54:03 +02:00
Cohee
3085dbe12c Merge branch 'staging' into extensions-router 2023-12-04 21:51:00 +02:00