mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
fix(web): show send tool calls in chat
Remove the frontend filter that hid send tool blocks delivered to the current conversation so assistant actions remain visible in chat.
This commit is contained in:
@@ -192,7 +192,7 @@
|
|||||||
|
|
||||||
<!-- Tool call block -->
|
<!-- Tool call block -->
|
||||||
<ToolCallBlock
|
<ToolCallBlock
|
||||||
v-else-if="block.type === 'tool' && !isHiddenToolMessage(block)"
|
v-else-if="block.type === 'tool'"
|
||||||
:block="(block as ToolCallBlockType)"
|
:block="(block as ToolCallBlockType)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -257,7 +257,6 @@ import ChannelBadge from '@/components/chat-list/channel-badge/index.vue'
|
|||||||
// import { useI18n } from 'vue-i18n'
|
// import { useI18n } from 'vue-i18n'
|
||||||
import type {
|
import type {
|
||||||
ChatMessage,
|
ChatMessage,
|
||||||
ContentBlock,
|
|
||||||
ThinkingBlock as ThinkingBlockType,
|
ThinkingBlock as ThinkingBlockType,
|
||||||
ToolCallBlock as ToolCallBlockType,
|
ToolCallBlock as ToolCallBlockType,
|
||||||
AttachmentBlock as AttachmentBlockType,
|
AttachmentBlock as AttachmentBlockType,
|
||||||
@@ -334,12 +333,6 @@ const userAttachmentBlock = computed<AttachmentBlockType | null>(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function isHiddenToolMessage(block: ContentBlock): boolean {
|
|
||||||
if (block.type !== 'tool') return false
|
|
||||||
const result = block.result as Record<string, unknown> | null
|
|
||||||
return !!result && typeof result === 'object' && result.delivered === 'current_conversation'
|
|
||||||
}
|
|
||||||
|
|
||||||
function hasLaterAssistantMessage(index: number): boolean {
|
function hasLaterAssistantMessage(index: number): boolean {
|
||||||
return props.message.role === 'assistant' && props.message.messages.slice(index + 1).length > 0
|
return props.message.role === 'assistant' && props.message.messages.slice(index + 1).length > 0
|
||||||
}
|
}
|
||||||
@@ -350,7 +343,7 @@ function isAssistantBlockStreaming(index: number): boolean {
|
|||||||
|
|
||||||
const hasVisibleAssistantBlocks = computed(() =>
|
const hasVisibleAssistantBlocks = computed(() =>
|
||||||
props.message.role === 'assistant'
|
props.message.role === 'assistant'
|
||||||
&& props.message.messages.some(block => block.type !== 'tool' || !isHiddenToolMessage(block)),
|
&& props.message.messages.length > 0,
|
||||||
)
|
)
|
||||||
|
|
||||||
const relativeTimestamp = computed(() =>
|
const relativeTimestamp = computed(() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user