mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Rename throwing head
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user