Hide empty assistant messages until content arrives
This commit is contained in:
@@ -294,6 +294,13 @@ export default function MessageStream(props: MessageStreamProps) {
|
|||||||
const version = message.version ?? 0
|
const version = message.version ?? 0
|
||||||
const isQueued = message.type === "user" && (lastAssistantIndex === -1 || index > lastAssistantIndex)
|
const isQueued = message.type === "user" && (lastAssistantIndex === -1 || index > lastAssistantIndex)
|
||||||
|
|
||||||
|
const hasRenderableContent =
|
||||||
|
message.type !== "assistant" ||
|
||||||
|
combinedParts.length > 0 ||
|
||||||
|
Boolean(messageInfo?.error) ||
|
||||||
|
message.status === "error"
|
||||||
|
|
||||||
|
if (hasRenderableContent) {
|
||||||
const cacheEntry = messageItemCache.get(message.id)
|
const cacheEntry = messageItemCache.get(message.id)
|
||||||
if (
|
if (
|
||||||
cacheEntry &&
|
cacheEntry &&
|
||||||
@@ -331,6 +338,7 @@ export default function MessageStream(props: MessageStreamProps) {
|
|||||||
})
|
})
|
||||||
items.push(messageItem)
|
items.push(messageItem)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (let toolIndex = 0; toolIndex < displayParts.tool.length; toolIndex++) {
|
for (let toolIndex = 0; toolIndex < displayParts.tool.length; toolIndex++) {
|
||||||
const toolPart = displayParts.tool[toolIndex]
|
const toolPart = displayParts.tool[toolIndex]
|
||||||
|
|||||||
Reference in New Issue
Block a user