change copy to act only on individual assitant/user blocks
This commit is contained in:
committed by
Shantur Rathore
parent
997d4f4129
commit
450f5bf0b4
@@ -16,7 +16,7 @@ interface MessageItemProps {
|
|||||||
showAgentMeta?: boolean
|
showAgentMeta?: boolean
|
||||||
onContentRendered?: () => void
|
onContentRendered?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function MessageItem(props: MessageItemProps) {
|
export default function MessageItem(props: MessageItemProps) {
|
||||||
const [copied, setCopied] = createSignal(false)
|
const [copied, setCopied] = createSignal(false)
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ interface MessageItemProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const messageParts = () => props.parts
|
const messageParts = () => props.parts
|
||||||
|
|
||||||
const fileAttachments = () =>
|
const fileAttachments = () =>
|
||||||
messageParts().filter((part): part is FilePart => part?.type === "file" && typeof (part as FilePart).url === "string")
|
messageParts().filter((part): part is FilePart => part?.type === "file" && typeof (part as FilePart).url === "string")
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ interface MessageItemProps {
|
|||||||
|
|
||||||
const getRawContent = () => {
|
const getRawContent = () => {
|
||||||
return props.parts
|
return props.parts
|
||||||
.filter(part => part.type === "text" || part.type === "reasoning")
|
.filter(part => part.type === "text")
|
||||||
.map(part => (part as { text?: string }).text || "")
|
.map(part => (part as { text?: string }).text || "")
|
||||||
.filter(text => text.trim().length > 0)
|
.filter(text => text.trim().length > 0)
|
||||||
.join("\n\n")
|
.join("\n\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user