mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-30 20:33:39 +00:00
ui: media attachments before text (#23467)
* ui: media attachments before text * fix prettier formatting
This commit is contained in:
parent
9627d0f540
commit
b96487645c
3 changed files with 9 additions and 11 deletions
|
|
@ -1 +1 @@
|
|||
export const MEGAPIXELS_TO_PIXELS = 1_000_000;
|
||||
export const MEGAPIXELS_TO_PIXELS = 1_000_000;
|
||||
|
|
|
|||
|
|
@ -879,14 +879,6 @@ export class ChatService {
|
|||
});
|
||||
}
|
||||
|
||||
if (message.content) {
|
||||
contentParts.push({
|
||||
type: ContentPartType.TEXT,
|
||||
text: message.content
|
||||
});
|
||||
}
|
||||
|
||||
// Include images from all messages
|
||||
const imageFiles = message.extra.filter(
|
||||
(extra: DatabaseMessageExtra): extra is DatabaseMessageExtraImageFile =>
|
||||
extra.type === AttachmentType.IMAGE
|
||||
|
|
@ -919,6 +911,13 @@ export class ChatService {
|
|||
});
|
||||
}
|
||||
|
||||
if (message.content) {
|
||||
contentParts.push({
|
||||
type: ContentPartType.TEXT,
|
||||
text: message.content
|
||||
});
|
||||
}
|
||||
|
||||
const videoFiles = message.extra.filter(
|
||||
(extra: DatabaseMessageExtra): extra is DatabaseMessageExtraVideoFile =>
|
||||
extra.type === AttachmentType.VIDEO
|
||||
|
|
|
|||
|
|
@ -14,9 +14,8 @@ export function capImageDataURLSize(
|
|||
): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
|
||||
const mimeMatch = base64UrlImage.match(BASE64_IMAGE_URI_REGEX);
|
||||
|
||||
|
||||
if (!mimeMatch) {
|
||||
return reject(new Error('Invalid data URL format.'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue