fix: pass image parts to custom commands (#6525)

Co-authored-by: Melih Mucuk <melih@monkeysteam.com>
This commit is contained in:
Melih Mucuk 2026-01-05 22:06:57 +03:00 committed by GitHub
commit a38e1701ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 81 additions and 3 deletions

View file

@ -1111,6 +1111,13 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
agent,
model: `${model.providerID}/${model.modelID}`,
variant,
parts: images.map((attachment) => ({
id: Identifier.ascending("part"),
type: "file" as const,
mime: attachment.mime,
url: attachment.dataUrl,
filename: attachment.filename,
})),
})
.catch((err) => {
showToast({
@ -1206,6 +1213,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
filename: attachment.filename,
}))
const messageID = Identifier.ascending("message")
const textPart = {
id: Identifier.ascending("part"),