Commit Graph

2513 Commits

Author SHA1 Message Date
valadaptive
77b02a8d4b Extract data.error check 2023-12-26 12:41:35 -05:00
valadaptive
0f8a16325b Extract dryRun early return from finishGenerating
This means we only have to handle it in one place rather than two.
2023-12-25 03:48:49 -05:00
valadaptive
3c0207f6cb Move "continue on send" logic out of Generate() 2023-12-25 03:48:49 -05:00
valadaptive
7899549754 Make "send message from chat box" into a function
Right now all it does is handle returning if there's already a message
being generated, but I'll extend it with more logic that I want to move
out of Generate().
2023-12-25 03:48:49 -05:00
valadaptive
1029ad90a2 Extract "not in a chat" check into guard clause
This lets us remove a layer of indentation, and reveal the error
handling logic that was previously hidden below a really long block of
code.
2023-12-25 03:48:49 -05:00
valadaptive
4fc2f15448 Reformat up Generate() group logic
The first two conditions in the group if/else blocks are the same, so we
can combine them.
2023-12-25 03:48:49 -05:00
valadaptive
0d3505c44b Remove OAI_BEFORE_CHATCOMPLETION
Not used in any internal code or extensions I can find.
2023-12-25 03:48:49 -05:00
valadaptive
d2f8632368 Remove populateLegacyTokenCounts
Unused and the documentation says it should probably be removed
2023-12-25 03:48:49 -05:00
valadaptive
f53e051cbf Lift precondition check out of processCommands
Instead of passing type and dryRun into processCommands, do the check in
Generate, the only function that calls it. This makes the logic clearer.
2023-12-25 03:48:49 -05:00
Cohee
47cb017a45 #1589 Add 'cache_prompt' for l.cpp 2023-12-25 02:42:03 +02:00
Cohee
352b00caca Merge branches 'staging' and 'staging' of https://github.com/SillyTavern/SillyTavern into staging 2023-12-24 23:11:11 +02:00
RigbyB
b6570e775d ComfyUI request/prompt fix 2023-12-24 21:02:04 +00:00
Cohee
4b254a75bc Add scale icon 2023-12-24 20:02:11 +02:00
Cohee
f8dece9d88 Always remove logit bias and stop from vision 2023-12-24 20:01:59 +02:00
Cohee
a9e074dae1 Don't recreate first message if generation was run at least once 2023-12-24 02:47:00 +02:00
Cohee
a8fb306c12 Add multimodal captioning for ooba 2023-12-24 01:43:29 +02:00
Doa
41ac2c07b2 Adding negative character prompts for img sources that support it 2023-12-23 16:19:22 +00:00
Cohee
db3bf42d63 Fix Firefox number arrows not updating the slider 2023-12-23 16:09:03 +02:00
Cohee
b7a338e130 Move all Horde requests to server 2023-12-22 22:10:09 +02:00
Cohee
89d70539b9 Alternative continue method for chat completions 2023-12-22 20:24:54 +02:00
Cohee
18445f527b Fix select2 empty message background + correct before selector 2023-12-22 02:22:09 +02:00
Cohee
45f6cb0fa8 Add chunked translate for long messages 2023-12-22 00:05:23 +02:00
Cohee
09fd772a20 #1579 Add ooba character yaml import 2023-12-21 21:46:09 +02:00
Cohee
4621834c87 Short formatting path for empty messages 2023-12-21 20:50:30 +02:00
Cohee
a85a6cf606 Allow displaying unreferenced macro in message texts 2023-12-21 20:49:03 +02:00
Cohee
39e0b0f5cb Remove custom Handlebars helpers for extensions. 2023-12-21 20:33:50 +02:00
valadaptive
8fb26284e2
Clean up Generate(), part 2 (#1578)
* Move StreamingProcessor constructor to the top

Typical code style is to declare the constructor at the top of the class
definition.

* Remove removePrefix

cleanupMessage does this already.

* Make message_already_generated local

We can pass it into StreamingProcessor so it doesn't have to be a global
variable.

* Consolidate setting isStopped and abort signal

Various places were doing some combination of setting isStopped, calling
abort on the streaming processor's abort controller, and calling
onStopStreaming. Let's consolidate all that functionality into
onStopStreaming/onErrorStreaming.

* More cleanly separate streaming/nonstreaming paths

* Replace promise with async function w/ handlers

By using onSuccess and onError as promise handlers, we can use normal
control flow and don't need to remember to use try/catch blocks or call
onSuccess every time.

* Remove runGenerate

Placing the rest of the code in a separate function doesn't really do
anything for its structure.

* Move StreamingProcessor() into streaming code path

* Fix return from circuit breaker

* Fix non-streaming chat completion request

* Fix Horde generation and quiet unblocking

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2023-12-21 20:20:28 +02:00
Cohee
bddccd0356 Missed several context bind cases 2023-12-21 17:19:42 +02:00
Cohee
b5e59c819c Merge branch 'staging' into claude-rework 2023-12-21 16:52:43 +02:00
Cohee
e1afe41c91 Fix custom expression duplication 2023-12-21 16:50:30 +02:00
Cohee
b3dfe16706 #1575 Fix clean-up WI depth injections 2023-12-21 16:33:21 +02:00
Cohee
dd661cf879 Instruct "Bind to context" is now an option 2023-12-21 15:12:30 +02:00
Cohee
ee75adbd2d Update persona name if it is bound by user name input 2023-12-21 14:56:32 +02:00
Cohee
f3099ac270 Remove model icon fill colors 2023-12-21 14:43:36 +02:00
Cohee
747867c6f4
Merge pull request #1580 from SillyTavern/custom
Custom API endpoint type for Chat Completion
2023-12-21 14:42:18 +02:00
RossAscends
afdd9d823e Merge branch 'staging' of https://github.com/Cohee1207/SillyTavern into staging 2023-12-21 12:43:59 +09:00
RossAscends
348cc5f2a5 placeholder API icon for tabby 2023-12-21 12:43:57 +09:00
Cohee
3001db3a47 Add additional parameters for custom endpoints 2023-12-20 23:39:10 +02:00
Cohee
e42daa4098 Add caption ask prompt mode 2023-12-20 21:23:59 +02:00
Cohee
ae64c99835 Add custom caption source 2023-12-20 21:05:20 +02:00
Cohee
cf8d7e7d35 Merge branch 'staging' into custom 2023-12-20 18:37:47 +02:00
Cohee
ebec26154c Welcome message fixed 2023-12-20 18:37:34 +02:00
Cohee
5734dbd17c Add custom endpoint type 2023-12-20 18:29:03 +02:00
Cohee
041b9d4b01 Add style sanitizer to message renderer 2023-12-20 17:03:37 +02:00
Cohee
c212a71425 Fix ignore list of preset manager 2023-12-20 15:51:00 +02:00
Cohee
b0a4341571
Merge pull request #1574 from artisticMink/feature/before-combine-event
Allow extensions to alter the context order.
2023-12-20 15:46:34 +02:00
Cohee
93db2bf953 Simplify extras summary settings 2023-12-20 01:56:35 +02:00
Cohee
4b131067e4 Add local multimodal caption sources 2023-12-20 00:45:45 +02:00
Cohee
029cf598ce Fix /peek command 2023-12-19 23:12:14 +02:00
maver
8d63ce5559 Log Novel Ai prompt to console
When prompt logging is enabled.
2023-12-19 19:27:24 +01:00