Commit Graph

1210 Commits

Author SHA1 Message Date
315d981804 Reject generation on circuit breaker error 2023-12-10 18:13:34 -05:00
ae9445e500 Reject on data.error 2023-12-10 13:56:31 -05:00
5fd466b53f Fix generateQuietPrompt 2023-12-10 13:54:39 -05:00
420d186823 Add reduced motion toggle 2023-12-10 20:02:25 +02:00
33f969f097 Have Generate() return a promise
Generate(), being async, now returns a promise-within-a-promise.
If called with `let p = await Generate(...)`, it'll wait for generation
to *start*. If you then `await p`, you'll wait for generation to
*finish*. This makes it much easier to tell exactly when generation's
done. generateGroupWrapper has been similarly modified.
2023-12-10 12:30:10 -05:00
03884b29ad Always call resolve in Generate()
This lets us get rid of the janky hack in group-chats to tell when a
message is done generating.
2023-12-10 12:26:30 -05:00
dbd52a7994 Merge pull request #1482 from valadaptive/sse-stream
Refactor server-sent events parsing
2023-12-10 18:32:19 +02:00
d5140142fb Merge branch 'staging' into tokenizers-cleanup 2023-12-10 15:51:15 +02:00
e0d0e1dd66 Merge pull request #1502 from valadaptive/status-cleanup
Clean up getStatus code
2023-12-10 15:49:37 +02:00
6be1c6ff10 Merge pull request #1504 from valadaptive/store-compiled-templates
Cache compiled Handlebars templates
2023-12-10 15:32:52 +02:00
5f1683f43a More input padding and stricter sanitation 2023-12-10 15:07:39 +02:00
c48bc8a76e Cache compiled Handlebars templates
Since we already have a template cache, it makes sense to store the
templates in it *after* compiling them, to avoid the overhead of
re-compiling them every time we call renderTemplate.

I've also changed the cache from an object to a Map--it's more
semantically correct, and avoids weird edge cases like a template named
"hasOwnProperty" or some other function that exists as an object
property.
2023-12-09 21:29:36 -05:00
499d158c11 Remove last usage of getAPIServerUrl
Now that we're not using this in the tokenizers code, we can remove it.
2023-12-09 20:55:34 -05:00
babb127aee Move NovelAI status functions over to the rest
Have all the get(...)Status and event handler registrations in the same
areas, rather than having the NovelAI ones far away. I want to
eventually move all the API-specific stuff into separate modules, but
this will make things cleaner for the time being.
2023-12-09 18:41:51 -05:00
0ea0399ed1 Separate getStatus into Kobold/textgen versions
This adds a bit of duplicate code for the time being, but ultimately
makes the code less confusing because we only need to include the bits
that are relevant to the specific API in each function. We can also
remove API parameters that are useless depending on the endpoint.
2023-12-09 18:39:19 -05:00
04c83eae71 Use null coalescing operator 2023-12-09 16:07:55 +02:00
4692450975 Enable getPastCharacterChats to work with specific character ids 2023-12-09 14:36:15 +01:00
ba3966e148 Only refresh character list after all deletions have been processed. 2023-12-09 14:31:18 +01:00
3cfc32c16d Refactor error handling
Remove the StreamingProcessor.hook method and use a try-catch block to
await the generator promise and set the generator, handling errors with
onError if it fails.
2023-12-08 18:40:17 -05:00
b0e7b73a32 Fix streaming processor error handler hooks 2023-12-08 02:01:08 +02:00
990f958f4f #1484 Consolidate chat name template 2023-12-07 16:59:53 +02:00
2417ae9d87 #1484 Display version on close chat 2023-12-07 16:57:47 +02:00
9b7a0f3d35 Hide loader before displaying blocking error message 2023-12-07 12:29:12 +02:00
bd1f09c644 Add loader for chat renaming 2023-12-07 12:27:18 +02:00
698890ae0f Fix /delchat slash command 2023-12-07 12:20:33 +02:00
6efe95f4f1 Rename chat API endpoints 2023-12-06 19:58:24 -05:00
55d7bd6a87 Return last evaluation of random 2023-12-07 02:45:35 +02:00
f575e0d61d Add {{currentSwipeId}} / {{lastSwipeId}} macros 2023-12-07 02:35:24 +02:00
b58f14d1d2 Fix bulk menu not working 2023-12-06 00:55:42 +02:00
7f703704c7 Display loader on loading past chats 2023-12-06 00:42:41 +02:00
b689b8bd30 Rename character API endpoints
Precursor to moving the character API into its own module
2023-12-04 17:35:06 -05:00
ddd16c1469 Merge pull request #1452 from valadaptive/assets-router
Use Express router for assets + "files" endpoints
2023-12-04 21:29:52 +02:00
1ac494d468 Don't attempt to send files on dry runs. 2023-12-04 21:28:36 +02:00
3ad7d5d520 Negotiate formatting with VS Code autoformat 2023-12-04 20:59:11 +02:00
5f1bed1e70 Enable object-curly-spacing lint 2023-12-04 12:32:41 -05:00
3c59b5b7a5 Fix holdover textgenerationwebui_settings 2023-12-03 17:36:25 -05:00
9c33ddbafc Make textgen settings type checks more concise 2023-12-03 14:56:01 -05:00
047c897ead Remove is[API] functions
Just use an equality comparison. It's a bit longer, but only because
"textgenerationwebui_settings" is a long identifier.
2023-12-03 14:56:01 -05:00
ba54e3dea0 Replaces is_[api] params with api_type param
These were 5 mutually-exclusive booleans, which can be replaced with one
param that takes on 5 values, one for each API type.
2023-12-03 14:56:01 -05:00
939e938ba2 Disallow multiswipe for quiet gens 2023-12-03 20:56:25 +02:00
1786b0d340 #1403 Add Aphrodite multi-swipe 2023-12-03 20:40:09 +02:00
676cc7731e #1436 Add unlock to response length 2023-12-03 18:30:21 +02:00
91811f63b5 lint: Fix JSdocs 2023-12-03 14:23:20 +02:00
4cb9cd128f Rename bookmarks to checkpoints 2023-12-03 03:11:14 +02:00
2c949b672a Fix bulk edit and message context action styles 2023-12-03 02:17:02 +02:00
c9ab85d8c9 Add /forcesave command 2023-12-03 00:53:45 +02:00
1eb32b247e add close stop for cancel button 2023-12-02 21:45:08 +00:00
c10e298777 fix old popup closing next popup 2023-12-02 21:22:58 +00:00
ff46a249d8 Add {{maxPrompt}} macro 2023-12-02 22:47:43 +02:00
6e09e45651 Fix /trigger and /continue auto-execution 2023-12-02 22:34:46 +02:00