Rename throwing head

This commit is contained in:
Enrico Ros
2024-12-30 13:47:54 -08:00
parent 8584a56a6d
commit ec9243b8dd
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -268,7 +268,7 @@ export function AppChat() {
if (!focusedPaneConversationId) return;
const cHandler = ConversationsManager.getHandler(focusedPaneConversationId);
if (!cHandler.isValid()) return;
const inputHistory = cHandler.historyViewHead('chat-beam-shortcut');
const inputHistory = cHandler.historyViewHeadOrThrow('chat-beam-shortcut');
if (!inputHistory.length) return;
// TODO: replace the Persona and Auto-Cache-hint in the history?
+1 -1
View File
@@ -138,7 +138,7 @@ export function ChatMessageList(props: {
const handleMessageBeam = React.useCallback(async (messageId: DMessageId) => {
// Message option menu Beam
if (!conversationId || !props.conversationHandler || !props.conversationHandler.isValid()) return;
const inputHistory = props.conversationHandler.historyViewHead('chat-beam-message');
const inputHistory = props.conversationHandler.historyViewHeadOrThrow('chat-beam-message');
if (!inputHistory.length) return;
// TODO: replace the Persona and Auto-Cache-hint in the history?
+2 -2
View File
@@ -24,7 +24,7 @@ export async function _handleExecute(chatExecuteMode: ChatExecuteMode, conversat
const chatLLMId = getChatLLMId();
const cHandler = ConversationsManager.getHandler(conversationId);
const initialHistory = cHandler.historyViewHead('chat-execute-' + executeCallerNameDebug) as Readonly<DMessage[]>;
const initialHistory = cHandler.historyViewHeadOrThrow('handle-execute-' + executeCallerNameDebug) as Readonly<DMessage[]>;
// Update the system message from the active persona to the history
// NOTE: this does NOT call setMessages anymore (optimization). make sure to:
@@ -72,7 +72,7 @@ export async function _handleExecute(chatExecuteMode: ChatExecuteMode, conversat
return await runPersonaOnConversationHead(chatLLMId, conversationId);
case 'beam-content':
const updatedInputHistory = cHandler.historyViewHead('chat-beam-execute');
const updatedInputHistory = cHandler.historyViewHeadOrThrow('chat-beam-execute');
cHandler.beamInvoke(updatedInputHistory, [], null);
return true;
+1 -1
View File
@@ -34,7 +34,7 @@ export async function runPersonaOnConversationHead(
const cHandler = ConversationsManager.getHandler(conversationId);
const _history = cHandler.historyViewHead('runPersonaOnConversationHead') as Readonly<DMessage[]>;
const _history = cHandler.historyViewHeadOrThrow('runPersonaOnConversationHead') as Readonly<DMessage[]>;
if (_history.length === 0)
return false;
@@ -209,7 +209,7 @@ export class ConversationHandler {
_chatStoreActions.historyTruncateToIncluded(this.conversationId, messageId, offset);
}
historyViewHead(scope: string): Readonly<DMessage[]> {
historyViewHeadOrThrow(scope: string): Readonly<DMessage[]> {
const messages = _chatStoreActions.historyView(this.conversationId);
if (messages === undefined)
throw new Error(`allMessages: Conversation not found, ${scope}`);
+1 -1
View File
@@ -95,7 +95,7 @@ export function DiagramsModal(props: { config: DiagramConfig, onClose: () => voi
setAbortController(stepAbortController);
// cHandler.setAbortController(stepAbortController);
const reChatHistory = cHandler.historyViewHead('diagrams-modal');
const reChatHistory = cHandler.historyViewHeadOrThrow('diagrams-modal');
const { chatSystemInstruction } = splitSystemMessageFromHistory(reChatHistory);
if (!chatSystemInstruction)
return setErrorMessage('No System instruction in this conversation');