|
|
@@ -1324,9 +1324,22 @@ export default function Page() {
|
|
|
attachmentName: language.t("common.attachment"),
|
|
|
})
|
|
|
|
|
|
+ const tag = (mime: string | undefined) => {
|
|
|
+ if (mime === "application/pdf") return "pdf"
|
|
|
+ if (mime?.startsWith("image/")) return "image"
|
|
|
+ return "file"
|
|
|
+ }
|
|
|
+
|
|
|
+ const chip = (part: { filename: string; mime: string }) => `[${tag(part.mime)}:${part.filename}]`
|
|
|
+
|
|
|
const line = (id: string) => {
|
|
|
const text = draft(id)
|
|
|
- .map((part) => (part.type === "image" ? `[image:${part.filename}]` : part.content))
|
|
|
+ .map((part) => {
|
|
|
+ if (part.type === "image") return chip(part)
|
|
|
+ if (part.type === "file") return `[file:${part.path}]`
|
|
|
+ if (part.type === "agent") return `@${part.name}`
|
|
|
+ return part.content
|
|
|
+ })
|
|
|
.join("")
|
|
|
.replace(/\s+/g, " ")
|
|
|
.trim()
|
|
|
@@ -1394,7 +1407,7 @@ export default function Page() {
|
|
|
const followupText = (item: FollowupDraft) => {
|
|
|
const text = item.prompt
|
|
|
.map((part) => {
|
|
|
- if (part.type === "image") return `[image:${part.filename}]`
|
|
|
+ if (part.type === "image") return chip(part)
|
|
|
if (part.type === "file") return `[file:${part.path}]`
|
|
|
if (part.type === "agent") return `@${part.name}`
|
|
|
return part.content
|