diff --git a/src/common/stores/chat/chat.fragments.ts b/src/common/stores/chat/chat.fragments.ts index 201e101b0..3f58e250f 100644 --- a/src/common/stores/chat/chat.fragments.ts +++ b/src/common/stores/chat/chat.fragments.ts @@ -153,7 +153,7 @@ type DMessageToolEnvironment = 'upstream' | 'server' | 'client'; type DVoidModelAuxPart = { pt: 'ma', aType: 'reasoning' | string, aText: string }; -type DVoidPlaceholderPart = { pt: 'ph', pText: string }; +type DVoidPlaceholderPart = { pt: 'ph', pText: string, pType?: 'chat-gen-follow-up', /* 2025-02-23: added for non-pure-text placeholders */ }; type _SentinelPart = { pt: '_pt_sentinel' }; @@ -292,8 +292,8 @@ export function createModelAuxVoidFragment(aType: DVoidModelAuxPart['aType'], aT return _createVoidFragment(_create_ModelAux_Part(aType, aText)); } -export function createPlaceholderVoidFragment(placeholderText: string): DMessageVoidFragment { - return _createVoidFragment(_create_Placeholder_Part(placeholderText)); +export function createPlaceholderVoidFragment(placeholderText: string, placeholderType?: DVoidPlaceholderPart['pType']): DMessageVoidFragment { + return _createVoidFragment(_create_Placeholder_Part(placeholderText, placeholderType)); } function _createVoidFragment(part: DMessageVoidFragment['part']): DMessageVoidFragment { @@ -372,8 +372,8 @@ function _create_ModelAux_Part(aType: DVoidModelAuxPart['aType'], aText: string) return { pt: 'ma', aType, aText }; } -function _create_Placeholder_Part(placeholderText: string): DVoidPlaceholderPart { - return { pt: 'ph', pText: placeholderText }; +function _create_Placeholder_Part(placeholderText: string, pType?: DVoidPlaceholderPart['pType']): DVoidPlaceholderPart { + return { pt: 'ph', pText: placeholderText, ...(pType ? { pType } : undefined) }; } function _create_Sentinel_Part(): _SentinelPart { @@ -396,7 +396,7 @@ function _duplicate_Part