Record uploaded assets in conversation packages
This commit is contained in:
+8
-1
@@ -693,7 +693,12 @@ export async function listMindSpaceAssets(
|
||||
export async function uploadMindSpaceAsset(
|
||||
categoryId: string,
|
||||
file: File,
|
||||
options: { maxImageBytes?: number; onProgress?: (progress: number) => void } = {},
|
||||
options: {
|
||||
maxImageBytes?: number;
|
||||
onProgress?: (progress: number) => void;
|
||||
sessionId?: string | null;
|
||||
messageId?: string | null;
|
||||
} = {},
|
||||
): Promise<MindSpaceAsset> {
|
||||
const maxImageBytes = options.maxImageBytes ?? CHAT_IMAGE_UPLOAD_MAX_INPUT_BYTES;
|
||||
if (file.type.startsWith('image/') && file.size > maxImageBytes) {
|
||||
@@ -710,6 +715,8 @@ export async function uploadMindSpaceAsset(
|
||||
filename: file.name,
|
||||
size_bytes: file.size,
|
||||
declared_mime_type: file.type || null,
|
||||
...(options.sessionId ? { session_id: options.sessionId } : {}),
|
||||
...(options.messageId ? { message_id: options.messageId } : {}),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user