wip: file part source in server/api (optional)

This commit is contained in:
adamdotdevin
2025-07-20 05:38:52 -05:00
parent c18f9ece69
commit 2bf9d5d4ec
7 changed files with 438 additions and 27 deletions

View File

@@ -490,6 +490,12 @@ export namespace Session {
synthetic: true,
text: result.output,
},
{
...part,
id: part.id ?? Identifier.ascending("part"),
messageID: userMsg.id,
sessionID: input.sessionID,
},
]
}
@@ -505,13 +511,14 @@ export namespace Session {
synthetic: true,
},
{
id: Identifier.ascending("part"),
id: part.id ?? Identifier.ascending("part"),
messageID: userMsg.id,
sessionID: input.sessionID,
type: "file",
url: `data:${part.mime};base64,` + Buffer.from(await file.bytes()).toString("base64"),
mime: part.mime,
filename: part.filename!,
source: part.source,
},
]
}