Add /genraw command
This commit is contained in:
parent
6d0982e823
commit
86819b6f4f
|
@ -24,6 +24,7 @@ import {
|
||||||
Generate,
|
Generate,
|
||||||
this_chid,
|
this_chid,
|
||||||
setCharacterName,
|
setCharacterName,
|
||||||
|
generateRaw,
|
||||||
} from "../script.js";
|
} from "../script.js";
|
||||||
import { getMessageTimeStamp } from "./RossAscends-mods.js";
|
import { getMessageTimeStamp } from "./RossAscends-mods.js";
|
||||||
import { findGroupMemberId, groups, is_group_generating, resetSelectedGroup, saveGroupChat, selected_group } from "./group-chats.js";
|
import { findGroupMemberId, groups, is_group_generating, resetSelectedGroup, saveGroupChat, selected_group } from "./group-chats.js";
|
||||||
|
@ -160,6 +161,7 @@ parser.addCommand('peek', peekCallback, [], '<span class="monospace">(message in
|
||||||
parser.addCommand('delswipe', deleteSwipeCallback, ['swipedel'], '<span class="monospace">(optional 1-based id)</span> – deletes a swipe from the last chat message. If swipe id not provided - deletes the current swipe.', true, true);
|
parser.addCommand('delswipe', deleteSwipeCallback, ['swipedel'], '<span class="monospace">(optional 1-based id)</span> – deletes a swipe from the last chat message. If swipe id not provided - deletes the current swipe.', true, true);
|
||||||
parser.addCommand('echo', echoCallback, [], '<span class="monospace">(text)</span> – echoes the text to toast message. Useful for pipes debugging.', true, true);
|
parser.addCommand('echo', echoCallback, [], '<span class="monospace">(text)</span> – echoes the text to toast message. Useful for pipes debugging.', true, true);
|
||||||
parser.addCommand('gen', generateCallback, [], '<span class="monospace">(prompt)</span> – generates text using the provided prompt and passes it to the next command through the pipe.', true, true);
|
parser.addCommand('gen', generateCallback, [], '<span class="monospace">(prompt)</span> – generates text using the provided prompt and passes it to the next command through the pipe.', true, true);
|
||||||
|
parser.addCommand('genraw', generateRawCallback, [], '<span class="monospace">(prompt)</span> – generates text using the provided prompt and passes it to the next command through the pipe. Does not include chat history or character card.', true, true);
|
||||||
parser.addCommand('addswipe', addSwipeCallback, ['swipeadd'], '<span class="monospace">(text)</span> – adds a swipe to the last chat message.', true, true);
|
parser.addCommand('addswipe', addSwipeCallback, ['swipeadd'], '<span class="monospace">(text)</span> – adds a swipe to the last chat message.', true, true);
|
||||||
registerVariableCommands();
|
registerVariableCommands();
|
||||||
|
|
||||||
|
@ -167,6 +169,19 @@ const NARRATOR_NAME_KEY = 'narrator_name';
|
||||||
const NARRATOR_NAME_DEFAULT = 'System';
|
const NARRATOR_NAME_DEFAULT = 'System';
|
||||||
export const COMMENT_NAME_DEFAULT = 'Note';
|
export const COMMENT_NAME_DEFAULT = 'Note';
|
||||||
|
|
||||||
|
async function generateRawCallback(_, arg) {
|
||||||
|
if (!arg) {
|
||||||
|
console.warn('WARN: No argument provided for /genraw command');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevent generate recursion
|
||||||
|
$('#send_textarea').val('');
|
||||||
|
|
||||||
|
const result = await generateRaw(arg, '');
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
async function generateCallback(_, arg) {
|
async function generateCallback(_, arg) {
|
||||||
if (!arg) {
|
if (!arg) {
|
||||||
console.warn('WARN: No argument provided for /gen command');
|
console.warn('WARN: No argument provided for /gen command');
|
||||||
|
|
Loading…
Reference in New Issue