mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Beam: remove /beam, it's not really a command
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { ChatBeamIcon } from '~/common/components/icons/ChatBeamIcon';
|
||||
|
||||
import type { ICommandsProvider } from './ICommandsProvider';
|
||||
|
||||
export const CommandsBeam: ICommandsProvider = {
|
||||
id: 'cmd-mode-beam',
|
||||
rank: 9,
|
||||
|
||||
getCommands: () => [{
|
||||
primary: '/beam',
|
||||
arguments: ['prompt'],
|
||||
description: 'Combine the smarts of models',
|
||||
Icon: ChatBeamIcon,
|
||||
}],
|
||||
|
||||
};
|
||||
@@ -1,14 +1,13 @@
|
||||
import { ChatCommand, ICommandsProvider } from './ICommandsProvider';
|
||||
|
||||
import { CommandsAlter } from './CommandsAlter';
|
||||
import { CommandsBeam } from './CommandsBeam';
|
||||
import { CommandsBrowse } from './CommandsBrowse';
|
||||
import { CommandsDraw } from './CommandsDraw';
|
||||
import { CommandsHelp } from './CommandsHelp';
|
||||
import { CommandsReact } from './CommandsReact';
|
||||
|
||||
|
||||
export type CommandsProviderId = 'cmd-ass-browse' | 'cmd-ass-t2i' | 'cmd-chat-alter' | 'cmd-help' | 'cmd-mode-beam' | 'cmd-mode-react';
|
||||
export type CommandsProviderId = 'cmd-ass-browse' | 'cmd-ass-t2i' | 'cmd-chat-alter' | 'cmd-help' | 'cmd-mode-react';
|
||||
|
||||
type TextCommandPiece =
|
||||
| { type: 'nocmd'; value: string; }
|
||||
@@ -20,7 +19,6 @@ const ChatCommandsProviders: Record<CommandsProviderId, ICommandsProvider> = {
|
||||
'cmd-ass-t2i': CommandsDraw,
|
||||
'cmd-chat-alter': CommandsAlter,
|
||||
'cmd-help': CommandsHelp,
|
||||
'cmd-mode-beam': CommandsBeam,
|
||||
'cmd-mode-react': CommandsReact,
|
||||
};
|
||||
|
||||
|
||||
@@ -666,9 +666,9 @@ export function Composer(props: {
|
||||
!llmAttachmentDraftsCollection.canAttachAllFragments ? 'warning'
|
||||
: undefined;
|
||||
|
||||
// stable randomization of the /verb, between '/draw', '/react', '/beam', '/browse'
|
||||
// stable randomization of the /verb, between '/draw', '/react', '/browse'
|
||||
const placeholderAction = React.useMemo(() => {
|
||||
const actions = ['/react', '/beam'];
|
||||
const actions: string[] = ['/react'];
|
||||
if (props.capabilityHasT2I) actions.push('/draw');
|
||||
if (hasComposerBrowseCapability) actions.push('/browse');
|
||||
return actions[Math.floor(Math.random() * actions.length)];
|
||||
|
||||
@@ -58,13 +58,15 @@ export async function _handleExecuteCommand(lastMessageId: DMessageId, lastMessa
|
||||
cHandler.messageAppendAssistantText(`Available Chat Commands:\n${helpPrettyChatCommands()}`, 'help');
|
||||
return true;
|
||||
|
||||
case 'cmd-mode-beam':
|
||||
if (isErrorNoArgs || !userText)
|
||||
return false;
|
||||
// remove '/beam ', as we want to be a user chat message
|
||||
cHandler.messageFragmentReplace(lastMessageId, lastMessageFirstFragment.fId, createTextContentFragment(userText), true);
|
||||
cHandler.beamInvoke(cHandler.historyViewHead('cmd-mode-beam'), [], null);
|
||||
return true;
|
||||
// NOTE 12/9/2024: removed this as /beam should not be a command, but it's already a chat mode, e.g. can't be headless executed.
|
||||
// the following code is here for reference/historical reasons
|
||||
// case 'cmd-mode-beam':
|
||||
// if (isErrorNoArgs || !userText)
|
||||
// return false;
|
||||
// // remove '/beam ', as we want to be a user chat message
|
||||
// cHandler.messageFragmentReplace(lastMessageId, lastMessageFirstFragment.fId, createTextContentFragment(userText), true);
|
||||
// cHandler.beamInvoke(cHandler.historyViewHead('cmd-mode-beam'), [], null);
|
||||
// return true;
|
||||
|
||||
case 'cmd-mode-react':
|
||||
// create a temporary copy of the message,
|
||||
|
||||
Reference in New Issue
Block a user